MCPcopy
hub / github.com/darkreader/darkreader / saveSyncSetting

Method saveSyncSetting

src/background/user-storage.ts:167–176  ·  view source on GitHub ↗
(sync: boolean)

Source from the content-addressed store, hash-verified

165 }
166
167 static async saveSyncSetting(sync: boolean): Promise<void> {
168 const obj = {syncSettings: sync};
169 await writeLocalStorage(obj);
170 try {
171 await writeSyncStorage(obj);
172 } catch (err) {
173 logWarn('Settings synchronization was disabled due to error:', chrome.runtime.lastError);
174 UserStorage.set({syncSettings: false});
175 }
176 }
177
178 private static saveSettingsIntoStorage = debounce(SAVE_TIMEOUT, async () => {
179 if (UserStorage.saveStorageBarrier) {

Callers 3

UserStorageClass · 0.80
changeSettingsMethod · 0.80

Calls 4

writeLocalStorageFunction · 0.90
writeSyncStorageFunction · 0.90
logWarnFunction · 0.90
setMethod · 0.65

Tested by

no test coverage detected