Skip to content

Commit

Permalink
Restore window on activate event
Browse files Browse the repository at this point in the history
  • Loading branch information
jlord committed Dec 16, 2015
1 parent 96be8d3 commit 803db72
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ const BrowserWindow = electron.BrowserWindow; // Module to create native browse
let mainWindow;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform != 'darwin') {
app.quit();
}
});

app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
app.emit('ready');
}
});

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
Expand Down

0 comments on commit 803db72

Please sign in to comment.