isNotFirstInstance -> isSecondInstance
This commit is contained in:
parent
1a6f6fd497
commit
da001940e2
1 changed files with 3 additions and 3 deletions
|
@ -701,7 +701,7 @@ starts:
|
||||||
const {app} = require('electron')
|
const {app} = require('electron')
|
||||||
let myWindow = null
|
let myWindow = null
|
||||||
|
|
||||||
const isNotFirstInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
|
const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
|
||||||
// Someone tried to run a second instance, we should focus our window.
|
// Someone tried to run a second instance, we should focus our window.
|
||||||
if (myWindow) {
|
if (myWindow) {
|
||||||
if (myWindow.isMinimized()) myWindow.restore()
|
if (myWindow.isMinimized()) myWindow.restore()
|
||||||
|
@ -709,8 +709,8 @@ const isNotFirstInstance = app.makeSingleInstance((commandLine, workingDirectory
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (isNotFirstInstance) {
|
if (isSecondInstance) {
|
||||||
app.quit();
|
app.quit()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create myWindow, load the rest of the app, etc...
|
// Create myWindow, load the rest of the app, etc...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue