Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
update electron
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Dec 26, 2018
1 parent 7a3462a commit 58ed2ed
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 118 deletions.
187 changes: 82 additions & 105 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/webcrypto": "0.0.28",
"@types/zxcvbn": "^4.4.0",
"concurrently": "3.5.1",
"electron": "2.0.11",
"electron": "3.0.13",
"jasmine": "^3.2.0",
"jasmine-core": "^3.2.1",
"jasmine-spec-reporter": "^4.2.1",
Expand Down Expand Up @@ -74,7 +74,7 @@
"big-integer": "1.6.36",
"core-js": "2.5.7",
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git",
"electron-log": "2.2.14",
"electron-log": "2.2.17",
"electron-updater": "3.0.3",
"form-data": "2.3.2",
"keytar": "4.2.1",
Expand Down
23 changes: 12 additions & 11 deletions src/electron/window.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ export class WindowMain {
return new Promise((resolve, reject) => {
try {
if (!isMacAppStore() && !isSnapStore()) {
const shouldQuit = app.makeSingleInstance((args, dir) => {
// Someone tried to run a second instance, we should focus our window.
if (this.win != null) {
if (this.win.isMinimized()) {
this.win.restore();
}
this.win.focus();
}
});

if (shouldQuit) {
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
return;
} else {
app.on('second-instance', (event, commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (this.win != null) {
if (this.win.isMinimized()) {
this.win.restore();
}
this.win.focus();
}
});
}
}

Expand Down

0 comments on commit 58ed2ed

Please sign in to comment.