Skip to content

Commit

Permalink
add debugging output for mainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk committed Nov 6, 2017
1 parent 84bff14 commit c95d6f3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,22 @@ if (isWindows) {
}

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

if (isSecondInstance) {
app.quit();
// if (process.platform !== 'darwin') {
const isSecondInstance = app.makeSingleInstance(() => {
console.log(mainWindow);
console.log('isMinimized', mainWindow.isMinimized);
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});

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

// }

// Initialize Settings
const settings = new Settings();

Expand Down Expand Up @@ -112,7 +115,7 @@ const createWindow = async () => {
});

mainWindow.on('close', (e) => {
if (settings.get('minimizeToSystemTray')) {
if (settings.get('minimizeToSystemTray') && settings.get('runInBackground')) {
e.preventDefault();
mainWindow.minimize();
}
Expand Down

0 comments on commit c95d6f3

Please sign in to comment.