mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-25 20:33:58 +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;
|
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', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user