From a6fe3c27d4f0e090f2e44a2957a68ed86e5cb568 Mon Sep 17 00:00:00 2001 From: asmsuechan Date: Sun, 12 Mar 2017 17:40:57 -0700 Subject: [PATCH] Fix a cyclic object value error --- browser/main/lib/ConfigManager.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index b8acb324..8069ce0a 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -71,17 +71,17 @@ function get () { config = Object.assign({}, DEFAULT_CONFIG, JSON.parse(config)) if (boostnotercConfig !== undefined) { + config = Object.assign({}, DEFAULT_CONFIG, boostnotercConfig) config.hotkey = Object.assign({}, DEFAULT_CONFIG.hotkey, boostnotercConfig.hotkey) config.ui = Object.assign({}, DEFAULT_CONFIG.ui, boostnotercConfig.ui) config.editor = Object.assign({}, DEFAULT_CONFIG.editor, boostnotercConfig.editor) config.preview = Object.assign({}, DEFAULT_CONFIG.preview, boostnotercConfig.preview) } - config = Object.assign(config, DEFAULT_CONFIG, config) - config.hotkey = Object.assign(config, DEFAULT_CONFIG.hotkey, config.hotkey) - config.ui = Object.assign(config, DEFAULT_CONFIG.ui, config.ui) - config.editor = Object.assign(config, DEFAULT_CONFIG.editor, config.editor) - config.preview = Object.assign(config, DEFAULT_CONFIG.preview, config.preview) + config.hotkey = Object.assign({}, DEFAULT_CONFIG.hotkey, config.hotkey) + config.ui = Object.assign({}, DEFAULT_CONFIG.ui, config.ui) + config.editor = Object.assign({}, DEFAULT_CONFIG.editor, config.editor) + config.preview = Object.assign({}, DEFAULT_CONFIG.preview, config.preview) if (!validate(config)) throw new Error('INVALID CONFIG') } catch (err) {