Skip to content

Commit

Permalink
Merge pull request #52 from TanukiPenny/master
Browse files Browse the repository at this point in the history
Add option to not close to tray
  • Loading branch information
JustYuuto authored Jul 11, 2024
2 parents 0f40cdb + c71822d commit ba46c4d
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 tray', 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 ba46c4d

Please sign in to comment.