1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

[update] by force, insert the default value to the customCSS config

This commit is contained in:
Kazumi Harada
2019-06-09 13:40:53 +09:00
committed by Junyoung Choi
parent 3f96587a70
commit 1ce72b91ca

View File

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