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