Skip to content

Commit 1ce72b9

Browse files
KazumiHARADARokt33r
authored andcommitted
[update] by force, insert the default value to the customCSS config
1 parent 3f96587 commit 1ce72b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

browser/main/lib/ConfigManager.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ function get () {
154154

155155
function set (updates) {
156156
const currentConfig = get()
157-
const newConfig = Object.assign({}, DEFAULT_CONFIG, currentConfig, updates)
157+
158+
let arrangedUpdates = updates
159+
if (updates.preview !== undefined && updates.preview.customCSS === "") {
160+
arrangedUpdates.preview.customCSS = DEFAULT_CONFIG.preview.customCSS
161+
}
162+
163+
const newConfig = Object.assign({}, DEFAULT_CONFIG, currentConfig, arrangedUpdates);
158164
if (!validate(newConfig)) throw new Error('INVALID CONFIG')
159165
_save(newConfig)
160166

0 commit comments

Comments
 (0)