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