mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
fix(plugin): fix onChangeConfig hook
This commit is contained in:
@ -12,8 +12,7 @@ const set = (key: string, value: unknown) => {
|
|||||||
};
|
};
|
||||||
const setPartial = (key: string, value: object) => {
|
const setPartial = (key: string, value: object) => {
|
||||||
const newValue = deepmerge(store.get(key) ?? {}, value);
|
const newValue = deepmerge(store.get(key) ?? {}, value);
|
||||||
console.log('sival', key, value, newValue);
|
store.set(key, newValue);
|
||||||
store.set(newValue);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function setMenuOption(key: string, value: unknown) {
|
function setMenuOption(key: string, value: unknown) {
|
||||||
|
|||||||
@ -111,10 +111,10 @@ const initHook = (win: BrowserWindow) => {
|
|||||||
Object.entries(newPluginConfigList).forEach(([id, newPluginConfig]) => {
|
Object.entries(newPluginConfigList).forEach(([id, newPluginConfig]) => {
|
||||||
const isEqual = deepEqual(oldPluginConfigList[id], newPluginConfig);
|
const isEqual = deepEqual(oldPluginConfigList[id], newPluginConfig);
|
||||||
|
|
||||||
console.log('check', id, isEqual, ';', oldPluginConfigList[id], newPluginConfig);
|
|
||||||
if (!isEqual) {
|
if (!isEqual) {
|
||||||
win.webContents.send('config-changed', id, newPluginConfig);
|
const config = deepmerge(pluginBuilders[id as keyof PluginBuilderList].config, newPluginConfig);
|
||||||
console.log('config-changed', id, newPluginConfig);
|
|
||||||
|
win.webContents.send('config-changed', id, config);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user