소스 검색

fixed issue with autosave all tabs on Chrome

Gildas 7 년 전
부모
커밋
8fd40ebb64
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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 });
 		}
 	}