Jelajahi Sumber

reset sync to false when resetting all the profiles

Former-commit-id: 0d918200218eb09d340e84b6be8942d732f300e5
Gildas 6 tahun lalu
induk
melakukan
3032555f17
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      extension/core/bg/config.js

+ 2 - 2
extension/core/bg/config.js

@@ -412,6 +412,8 @@ singlefile.extension.core.bg.config = (() => {
 		delete tabsData.profileName;
 		await singlefile.extension.core.bg.tabsData.set(tabsData);
 		await configStorage.remove(["profiles", "rules", "maxParallelWorkers"]);
+		await browser.storage.local.set({ sync: false });
+		configStorage = browser.storage.local;
 		await upgrade();
 	}
 
@@ -422,8 +424,6 @@ singlefile.extension.core.bg.config = (() => {
 		}
 		config.profiles[profileName] = DEFAULT_CONFIG;
 		await configStorage.set({ profiles: config.profiles });
-		await browser.storage.local.set({ sync: false });
-		configStorage = browser.storage.local;
 	}
 
 	async function exportConfig() {