feat(tray): minimize to tray by default (#138)

This commit is contained in:
Nexmoe
2026-01-17 12:17:34 +08:00
committed by GitHub
parent 182a1b9c1e
commit 761adf2476
2 changed files with 14 additions and 2 deletions

View File

@@ -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()
})
})

View File

@@ -301,7 +301,7 @@ export const defaultSettings: AppSettings = {
oneClickDownload: false,
oneClickDownloadType: 'video',
oneClickQuality: 'best',
closeToTray: false,
closeToTray: true,
hideDockIcon: false,
launchAtLogin: false,
autoUpdate: true,