Tweak logic in makeSingleInstance callback
This commit is contained in:
parent
df46c3f4e5
commit
d888707d56
1 changed files with 7 additions and 9 deletions
16
app/main.js
16
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]);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue