MCPcopy Create free account
hub / github.com/Eltaurus-Lt/CourseDump2022 / loadSettings

Function loadSettings

menu.js:153–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153async function loadSettings() {
154 let settings = await loadFromStorage('settings') || default_settings;
155
156 //initiate if accessed for the first time or a new setting is added
157 let upd = false;
158 for (const [setting, default_value] of Object.entries(default_settings)) {
159 if (!(setting in settings && settings[setting] !== 'undefined')) {
160 settings[setting] = default_value;
161 upd = true;
162 }
163 }
164 if (upd) {saveToStorage({ settings });}
165
166 return settings;
167}
168
169async function loadQueue(text = false) {
170 let queue = await loadFromStorage(`queue${text ? '-text' : ''}`);

Callers 2

fromSettingsMethod · 0.85
downloadCoursesFunction · 0.85

Calls 2

loadFromStorageFunction · 0.85
saveToStorageFunction · 0.85

Tested by

no test coverage detected