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:
committed by
Junyoung Choi
parent
3f96587a70
commit
1ce72b91ca
@@ -154,7 +154,13 @@ function get () {
|
|||||||
|
|
||||||
function set (updates) {
|
function set (updates) {
|
||||||
const currentConfig = get()
|
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')
|
if (!validate(newConfig)) throw new Error('INVALID CONFIG')
|
||||||
_save(newConfig)
|
_save(newConfig)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user