diff --git a/src/main/index.ts b/src/main/index.ts index 00c2380..7abb167 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -474,9 +474,21 @@ app.whenReady().then(async () => { handleDeepLinkArgv(process.argv) app.on('activate', () => { + const existingWindow = BrowserWindow.getAllWindows().find((window) => !window.isDestroyed()) + if (existingWindow) { + if (existingWindow.isMinimized()) { + existingWindow.restore() + } + if (!existingWindow.isVisible()) { + existingWindow.show() + } + existingWindow.focus() + return + } + // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. - if (BrowserWindow.getAllWindows().length === 0) createWindow() + createWindow() }) }) diff --git a/src/shared/types/index.ts b/src/shared/types/index.ts index e4fe123..cecbf01 100644 --- a/src/shared/types/index.ts +++ b/src/shared/types/index.ts @@ -301,7 +301,7 @@ export const defaultSettings: AppSettings = { oneClickDownload: false, oneClickDownloadType: 'video', oneClickQuality: 'best', - closeToTray: false, + closeToTray: true, hideDockIcon: false, launchAtLogin: false, autoUpdate: true,