From 1ce72b91ca636baad03b4ab5192e403f3cb71655 Mon Sep 17 00:00:00 2001 From: Kazumi Harada Date: Sun, 9 Jun 2019 13:40:53 +0900 Subject: [PATCH] [update] by force, insert the default value to the customCSS config --- browser/main/lib/ConfigManager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index 85310e5c..a1868047 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -154,7 +154,13 @@ function get () { function set (updates) { const currentConfig = get() - const newConfig = Object.assign({}, DEFAULT_CONFIG, currentConfig, updates) + + let arrangedUpdates = updates + if (updates.preview !== undefined && updates.preview.customCSS === "") { + arrangedUpdates.preview.customCSS = DEFAULT_CONFIG.preview.customCSS + } + + const newConfig = Object.assign({}, DEFAULT_CONFIG, currentConfig, arrangedUpdates); if (!validate(newConfig)) throw new Error('INVALID CONFIG') _save(newConfig)