Merge branch 'agents/single-instance-app-launch'

This commit is contained in:
David Kaya
2026-04-16 13:56:19 +02:00
+10
View File
@@ -16,6 +16,12 @@ import { createDefaultQuickPromptSettings } from '@shared/domain/tooling';
const { app, BrowserWindow } = electron; 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 mainWindow: BrowserWindowType | undefined;
let quickPromptWindow: BrowserWindowType | undefined; let quickPromptWindow: BrowserWindowType | undefined;
let appService: AryxAppService | undefined; let appService: AryxAppService | undefined;
@@ -109,6 +115,10 @@ async function bootstrap(): Promise<void> {
autoUpdateService.start(); autoUpdateService.start();
} }
app.on('second-instance', () => {
showAndFocusWindow();
});
app.whenReady().then(bootstrap); app.whenReady().then(bootstrap);
app.on('window-all-closed', () => { app.on('window-all-closed', () => {