add reset settings option

This commit is contained in:
Argn0
2022-05-24 10:04:56 +02:00
parent 393861dcd3
commit 3007cddce9
4 changed files with 39 additions and 6 deletions

View File

@@ -113,6 +113,7 @@ export interface SBObject {
local: SBStorage;
forceSyncUpdate(prop: string): void;
forceLocalUpdate(prop: string): void;
resetToDefault(): void;
}
const Config: SBObject = {
@@ -289,7 +290,8 @@ const Config: SBObject = {
config: null,
local: null,
forceSyncUpdate,
forceLocalUpdate
forceLocalUpdate,
resetToDefault
};
// Function setup
@@ -522,6 +524,10 @@ function addDefaults() {
}
}
function resetToDefault() {
chrome.storage.sync.set(Config.syncDefaults);
}
// Sync config
setupConfig();