diff --git a/src/main/index.ts b/src/main/index.ts index 711d3e207..b6a500e57 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -390,8 +390,11 @@ const createTray = () => { }, { click: () => { - mainWindow?.show(); - createWinThumbarButtons(); + if (mainWindow === null) createWindow(false); + else { + mainWindow.show(); + createWinThumbarButtons(); + } }, label: 'Open main window', }, @@ -618,6 +621,7 @@ async function createWindow(first = true): Promise { mainWindow.on('closed', () => { ipcMain.removeHandler('window-clear-cache'); + ipcMain.removeHandler('app-check-for-updates'); mainWindow = null; });