feat: close-to-tray default + system settings entry; bump 1.0.3
This commit is contained in:
1 parent
8f686f56ca
commit
2b3fefafd0
4 files changed
+20
-4
No files matched your search
+2
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user