Skip to content

Commit

Permalink
Add option to not close to tray
Browse files Browse the repository at this point in the history
  • Loading branch information
TanukiPenny committed Jul 8, 2024
1 parent 0f40cdb commit d07d6d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/Tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions src/utils/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit d07d6d1

Please sign in to comment.