1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Fix a cyclic object value error

This commit is contained in:
asmsuechan
2017-03-12 17:40:57 -07:00
parent d47ff96b13
commit a6fe3c27d4

View File

@@ -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) {