mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 20:31:46 +00:00
fix: fix restartNeeded
This commit is contained in:
@ -157,7 +157,7 @@ const initHook = (win: BrowserWindow) => {
|
|||||||
forceUnloadMainPlugin(id, win);
|
forceUnloadMainPlugin(id, win);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainPlugins[id]?.restartNeeded) {
|
if (allPlugins[id]?.restartNeeded) {
|
||||||
showNeedToRestartDialog(id);
|
showNeedToRestartDialog(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,14 +176,14 @@ const initHook = (win: BrowserWindow) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const showNeedToRestartDialog = (id: string) => {
|
const showNeedToRestartDialog = (id: string) => {
|
||||||
const plugin = mainPlugins[id];
|
const plugin = allPlugins[id];
|
||||||
|
|
||||||
const dialogOptions: Electron.MessageBoxOptions = {
|
const dialogOptions: Electron.MessageBoxOptions = {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
buttons: ['Restart Now', 'Later'],
|
buttons: ['Restart Now', 'Later'],
|
||||||
title: 'Restart Required',
|
title: 'Restart Required',
|
||||||
message: `"${plugin.name ?? id}" needs to restart`,
|
message: `"${plugin?.name ?? id}" needs to restart`,
|
||||||
detail: `"${plugin.name ?? id}" plugin requires a restart to take effect`,
|
detail: `"${plugin?.name ?? id}" plugin requires a restart to take effect`,
|
||||||
defaultId: 0,
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export const forceUnloadPreloadPlugin = (id: string) => {
|
|||||||
hasStopped ||
|
hasStopped ||
|
||||||
(
|
(
|
||||||
hasStopped === null &&
|
hasStopped === null &&
|
||||||
typeof loadedPluginMap[id].preload !== 'function' && loadedPluginMap[id].preload
|
loadedPluginMap[id].preload
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
console.log(LoggerPrefix, `"${id}" plugin is unloaded`);
|
console.log(LoggerPrefix, `"${id}" plugin is unloaded`);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export const forceUnloadRendererPlugin = (id: string) => {
|
|||||||
hasStopped ||
|
hasStopped ||
|
||||||
(
|
(
|
||||||
hasStopped === null &&
|
hasStopped === null &&
|
||||||
typeof plugin?.renderer !== 'function' && plugin?.renderer
|
plugin?.renderer
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
console.log(LoggerPrefix, `"${id}" plugin is unloaded`);
|
console.log(LoggerPrefix, `"${id}" plugin is unloaded`);
|
||||||
|
|||||||
Reference in New Issue
Block a user