mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-24 21:48:36 +02:00
Merge branch 'agents/single-instance-app-launch'
This commit is contained in:
@@ -16,6 +16,12 @@ import { createDefaultQuickPromptSettings } from '@shared/domain/tooling';
|
||||
|
||||
const { app, BrowserWindow } = electron;
|
||||
|
||||
// Enforce single instance — quit immediately if another instance already holds the lock.
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
if (!gotTheLock) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
let mainWindow: BrowserWindowType | undefined;
|
||||
let quickPromptWindow: BrowserWindowType | undefined;
|
||||
let appService: AryxAppService | undefined;
|
||||
@@ -109,6 +115,10 @@ async function bootstrap(): Promise<void> {
|
||||
autoUpdateService.start();
|
||||
}
|
||||
|
||||
app.on('second-instance', () => {
|
||||
showAndFocusWindow();
|
||||
});
|
||||
|
||||
app.whenReady().then(bootstrap);
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
||||
Reference in New Issue
Block a user