feat: close-to-tray default + system settings entry; bump 1.0.3

This commit is contained in:
Bill committed 2026-09-08 17:00:09 +08:00
1 parent 8f686f56ca
commit 2b3fefafd0
4 files changed
+20 -4

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ function showMainWindow(showOrCreate: () => void): void {
/** Rebuild the context menu so the close-action radio items reflect settings. */
function refreshContextMenu(showOrCreate: () => void): void {
if (!tray) return
const action = loadSettings().system.closeAction ?? 'ask'
const action = loadSettings().system.closeAction ?? 'tray'
const setAction = (value: CloseAction) => (): void => {
persistCloseAction(value)
refreshContextMenu(showOrCreate)
@@ -86,7 +86,7 @@ function hideToTray(win: BrowserWindow): void {
*/
export async function onMainWindowClose(win: BrowserWindow, e: Electron.Event, showOrCreate: () => void): Promise<void> {
if (quitting) return
const action = loadSettings().system.closeAction ?? 'ask'
const action = loadSettings().system.closeAction ?? 'tray'
if (action === 'tray') {
e.preventDefault()
hideToTray(win)