mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-05 15:38:46 +08:00
add singleton lock for openSettingWindow
This commit is contained in:
@@ -3,6 +3,12 @@ import { electronApp, optimizer } from '@electron-toolkit/utils'
|
|||||||
import { createMainWindow } from '../window/mainWindow'
|
import { createMainWindow } from '../window/mainWindow'
|
||||||
|
|
||||||
export function openSettingWindow() {
|
export function openSettingWindow() {
|
||||||
|
// TODO: singleton lock; how can we check if there is another process should run as singleton with arguments?
|
||||||
|
if (!app.requestSingleInstanceLock()) {
|
||||||
|
// TODO: log
|
||||||
|
app.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
|
|||||||
Reference in New Issue
Block a user