From d888707d5605293568e2f3018a63c4bbb372df4e Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 11 May 2017 00:03:39 -0400 Subject: [PATCH] Tweak logic in makeSingleInstance callback --- app/main.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/main.js b/app/main.js index 824ac8885..3328b928d 100644 --- a/app/main.js +++ b/app/main.js @@ -194,19 +194,17 @@ function quitNow() { } const isSecondaryInstance = app.makeSingleInstance((argv) => { - if (argv.length < 2) { - return; - } - - if (!win) { - openUri = denormalizeUri(argv[1]); - } else { + if (win) { if (win.isMinimized()) { win.restore(); - win.focus(); } + win.focus(); - win.webContents.send('open-uri-requested', denormalizeUri(argv[1])); + if (argv.length >= 2) { + win.webContents.send('open-uri-requested', denormalizeUri(argv[1])); + } + } else if (argv.length >= 2) { + openUri = denormalizeUri(argv[1]); } });