diff --git a/src/js/background/assignManager.js b/src/js/background/assignManager.js
index d986456..a9493c0 100644
--- a/src/js/background/assignManager.js
+++ b/src/js/background/assignManager.js
@@ -46,6 +46,11 @@ const assignManager = {
return this.getByUrlKey(siteStoreKey);
},
+ async getSyncEnabled() {
+ const { syncEnabled } = await browser.storage.local.get("syncEnabled");
+ return !!syncEnabled;
+ },
+
getByUrlKey(siteStoreKey) {
return new Promise((resolve, reject) => {
this.area.get([siteStoreKey]).then((storageResponse) => {
@@ -72,7 +77,8 @@ const assignManager = {
await this.area.set({
[siteStoreKey]: data
});
- if (backup) await sync.storageArea.backup({undeleteSiteStoreKey: siteStoreKey});
+ const syncEnabled = await this.getSyncEnabled();
+ if (backup && syncEnabled) await sync.storageArea.backup({undeleteSiteStoreKey: siteStoreKey});
return;
},
@@ -81,7 +87,8 @@ const assignManager = {
// When we remove an assignment we should clear all the exemptions
this.removeExempted(pageUrlorUrlKey);
await this.area.remove([siteStoreKey]);
- await sync.storageArea.backup({siteStoreKey});
+ const syncEnabled = await this.getSyncEnabled();
+ if (syncEnabled) await sync.storageArea.backup({siteStoreKey});
return;
},
diff --git a/src/js/background/index.html b/src/js/background/index.html
index c5c7889..3bb1a79 100644
--- a/src/js/background/index.html
+++ b/src/js/background/index.html
@@ -14,11 +14,11 @@
]
-->
-
+