From 522a2bdab313b18acce0dd63d306ba404e8bf699 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 10 Dec 2017 08:10:33 +0300 Subject: [PATCH] deep-copy style for popup's configDialog see #298 --- manage/config-dialog.js | 2 +- popup/popup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manage/config-dialog.js b/manage/config-dialog.js index c609d436..0661c333 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -164,7 +164,7 @@ function configDialog(style) { return; } saving = true; - return BG.usercssHelper.save(style) + return BG.usercssHelper.save(BG.deepCopy(style)) .then(saved => { varsInitial = getInitialValues(deepCopy(saved.usercssData.vars)); vars.forEach(va => onchange({target: va.input, justSaved: true})); diff --git a/popup/popup.js b/popup/popup.js index 9fb0fed6..f15ce92c 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -361,7 +361,7 @@ Object.assign(handleEvent, { if (styleIsUsercss) { getStylesSafe({id: styleId}).then(([style]) => { hotkeys.setState(false); - configDialog(style).then(() => { + configDialog(deepCopy(style)).then(() => { hotkeys.setState(true); }); });