Browse Source

fixed issue with autosave all tabs on Chrome

Gildas 7 years ago
parent
commit
8fd40ebb64
1 changed files with 5 additions and 1 deletions
  1. 5 1
      extension/core/bg/storage.js

+ 5 - 1
extension/core/bg/storage.js

@@ -62,7 +62,11 @@ singlefile.storage = (() => {
 	async function cleanup() {
 		if (persistentData) {
 			const tabs = await browser.tabs.query({});
-			Object.keys(persistentData).filter(tabId => !tabs.find(tab => tab.id == tabId)).forEach(tabId => delete persistentData[tabId]);
+			Object.keys(persistentData).filter(key => {
+				if (key != "autoSaveAll" && key != "autoSaveUnpinned") {
+					return !tabs.find(tab => tab.id == key);
+				}
+			}).forEach(tabId => delete persistentData[tabId]);
 			await browser.storage.local.set({ tabsData: persistentData });
 		}
 	}