Fix #462 - When minimized to tray and single-instance, re-running the app should activate and focus it (#490)

This commit is contained in:
Ronan Jouchet 2017-11-24 10:31:08 -05:00 committed by GitHub
parent 2b377a7916
commit 8963544afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -122,7 +122,9 @@ if (appArgs.singleInstance) {
const shouldQuit = app.makeSingleInstance(() => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) {
if (!mainWindow.isVisible()) { // tray
mainWindow.show();
} if (mainWindow.isMinimized()) { // minimized
mainWindow.restore();
}
mainWindow.focus();