mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
@@ -5,24 +5,23 @@ const ipc = electron.ipcMain
|
|||||||
const GhReleases = require('electron-gh-releases')
|
const GhReleases = require('electron-gh-releases')
|
||||||
const { isPackaged } = app
|
const { isPackaged } = app
|
||||||
// electron.crashReporter.start()
|
// electron.crashReporter.start()
|
||||||
|
const singleInstance = app.requestSingleInstanceLock()
|
||||||
|
|
||||||
var ipcServer = null
|
var ipcServer = null
|
||||||
|
|
||||||
var mainWindow = null
|
var mainWindow = null
|
||||||
|
|
||||||
var shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
|
// Single Instance Lock
|
||||||
if (mainWindow) {
|
if (!singleInstance) {
|
||||||
if (process.platform === 'win32') {
|
|
||||||
mainWindow.minimize()
|
|
||||||
mainWindow.restore()
|
|
||||||
}
|
|
||||||
mainWindow.focus()
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
|
|
||||||
if (shouldQuit) {
|
|
||||||
app.quit()
|
app.quit()
|
||||||
|
} else {
|
||||||
|
app.on('second-instance', () => {
|
||||||
|
// Someone tried to run a second instance, it should focus the existing instance.
|
||||||
|
if (mainWindow) {
|
||||||
|
if (!mainWindow.isVisible()) mainWindow.show()
|
||||||
|
mainWindow.focus()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var isUpdateReady = false
|
var isUpdateReady = false
|
||||||
|
|||||||
Reference in New Issue
Block a user