Skip to content

Commit

Permalink
Don't apply app.makeSingleInstance on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk committed Oct 24, 2017
1 parent 4293b89 commit 2bfe845
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ if (isWindows) {
}

// Force single window
const isSecondInstance = app.makeSingleInstance(() => {
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});
if (process.platform !== 'darwin') {
const isSecondInstance = app.makeSingleInstance(() => {
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});

if (isSecondInstance) {
app.quit();
if (isSecondInstance) {
app.quit();
}
}

// Initialize Settings
Expand Down

0 comments on commit 2bfe845

Please sign in to comment.