Skip to content

Commit

Permalink
Request single instance
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Oct 18, 2020
1 parent b625adb commit f9135dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if (!config.isDebug) {
Menu.setApplicationMenu(menu);
}

const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
}

let tray: Tray;
app.on('ready', () => {
if (settings.enableUpdateCheck === 'on') autoUpdater.checkForUpdatesAndNotify();
Expand Down
2 changes: 1 addition & 1 deletion src/main/tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class GtTray extends Tray {
{
label: 'Quit',
click() {
app.exit();
app.quit();
},
},
]);
Expand Down

0 comments on commit f9135dc

Please sign in to comment.