瀏覽代碼

clone data when creating a new profile (fix #276)

Former-commit-id: 14e8e24b128af8f057a2ff6a641b7e9a19655682
Gildas 6 年之前
父節點
當前提交
eebae79bbe
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      extension/core/bg/config.js

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

@@ -217,7 +217,7 @@ singlefile.extension.core.bg.config = (() => {
 		if (Object.keys(config.profiles).includes(profileName)) {
 			throw new Error("Duplicate profile name");
 		}
-		config.profiles[profileName] = config.profiles[fromProfileName];
+		config.profiles[profileName] = JSON.parse(JSON.stringify(config.profiles[fromProfileName]));
 		await browser.storage.local.set({ profiles: config.profiles });
 	}