From d07d6d14ed7a71196362f1b7bc8d60e98bfbea8c Mon Sep 17 00:00:00 2001 From: Penny Date: Mon, 8 Jul 2024 14:43:26 -0400 Subject: [PATCH] Add option to not close to tray --- src/utils/Tray.ts | 4 ++++ src/utils/Window.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/utils/Tray.ts b/src/utils/Tray.ts index 56e8d76..1498e27 100644 --- a/src/utils/Tray.ts +++ b/src/utils/Tray.ts @@ -37,6 +37,10 @@ export async function init(app: Electron.App, client: import('discord-rpc').Clie label: 'Only show RPC if music is playing', type: 'checkbox', checked: Config.get(app, 'only_show_if_playing'), click: (menuItem) => Config.set(app, 'only_show_if_playing', menuItem.checked) }, + { + label: 'Don\'t close to try', type: 'checkbox', checked: Config.get(app, 'dont_close_to_tray'), + click: (menuItem) => Config.set(app, 'dont_close_to_tray', menuItem.checked) + }, { id: 'reconnect', label: Config.get(app, 'use_listening_to') ? 'Reconnect to WebSocket' : 'Reconnect RPC', diff --git a/src/utils/Window.ts b/src/utils/Window.ts index cd0b692..4f252bf 100644 --- a/src/utils/Window.ts +++ b/src/utils/Window.ts @@ -84,6 +84,9 @@ export async function load(app: Electron.App) { }); win.on('close', (e) => { + if (Config.get(app, 'dont_close_to_tray')) { + return true; + } e.preventDefault(); win.hide();