fix: plugin config default value

This commit is contained in:
JellyBrick
2023-11-28 10:21:08 +09:00
parent 04d7b32d3f
commit 3e8a0ec49a
12 changed files with 44 additions and 91 deletions

View File

@ -11,8 +11,8 @@ import { restart } from '@/providers/app-controls';
const set = (key: string, value: unknown) => {
store.set(key, value);
};
const setPartial = (key: string, value: object) => {
const newValue = deepmerge(store.get(key) ?? {}, value);
const setPartial = (key: string, value: object, defaultValue?: object) => {
const newValue = deepmerge(defaultValue ?? {}, store.get(key) ?? {}, value);
store.set(key, newValue);
};