mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
override default values to undefined attributes of config
This commit is contained in:
@@ -53,6 +53,10 @@ function get () {
|
||||
|
||||
try {
|
||||
config = Object.assign({}, defaultConfig, JSON.parse(config))
|
||||
config.hotkey = Object.assign({}, defaultConfig.hotkey, config.hotkey)
|
||||
config.ui = Object.assign({}, defaultConfig.ui, config.ui)
|
||||
config.editor = Object.assign({}, defaultConfig.editor, config.editor)
|
||||
config.preview = Object.assign({}, defaultConfig.preview, config.preview)
|
||||
if (!validate(config)) throw new Error('INVALID CONFIG')
|
||||
} catch (err) {
|
||||
console.warn('Boostnote resets the malformed configuration.')
|
||||
|
||||
Reference in New Issue
Block a user