quit sooner with single instance lock
This commit is contained in:
parent
f93ffb9695
commit
963c20254e
1 changed files with 40 additions and 40 deletions
|
@ -8,7 +8,11 @@ import { analytics, id } from './telemetry'
|
|||
require('@electron/remote/main').initialize()
|
||||
|
||||
let tray: Tray | null = null
|
||||
|
||||
const SingleInstanceLock = app.requestSingleInstanceLock()
|
||||
if (!SingleInstanceLock) {
|
||||
app.quit()
|
||||
}
|
||||
|
||||
const createSystemtray = () => {
|
||||
let brightModeIconPath = path.join(__dirname, '..', '..', 'assets', 'ollama_icon_dark_16x16.png')
|
||||
|
@ -108,10 +112,7 @@ function installCLI() {
|
|||
})
|
||||
}
|
||||
|
||||
if (!SingleInstanceLock) {
|
||||
app.quit()
|
||||
} else {
|
||||
app.on('ready', () => {
|
||||
app.on('ready', () => {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.hide()
|
||||
|
||||
|
@ -153,8 +154,7 @@ if (!SingleInstanceLock) {
|
|||
if (app.isPackaged) {
|
||||
installCLI()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
|
|
Loading…
Reference in a new issue