1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

update electron

This commit is contained in:
Kyle Spearrin
2018-12-26 14:55:21 -05:00
parent 7a3462afda
commit 58ed2ed0a2
3 changed files with 96 additions and 118 deletions

View File

@@ -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();
}
});
}
}