diff --git a/src/electron/main.ts b/src/electron/main.ts index a95a611..c5688f2 100644 --- a/src/electron/main.ts +++ b/src/electron/main.ts @@ -10,6 +10,13 @@ import { getCurrentApiConfig } from "./libs/claude-settings.js"; import type { ClientEvent } from "./types.js"; import "./libs/claude-settings.js"; +// Disable sandbox and GPU acceleration to fix initialization issues on macOS +app.commandLine.appendSwitch('no-sandbox'); +app.commandLine.appendSwitch('disable-gpu'); +app.commandLine.appendSwitch('disable-software-rasterizer'); +app.commandLine.appendSwitch('in-process-gpu'); +app.commandLine.appendSwitch('disable-network-service'); + let cleanupComplete = false; let mainWindow: BrowserWindow | null = null; diff --git a/src/electron/util.ts b/src/electron/util.ts index 3978112..737819a 100644 --- a/src/electron/util.ts +++ b/src/electron/util.ts @@ -1,7 +1,12 @@ import { ipcMain, WebContents, WebFrameMain } from "electron"; import { getUIPath } from "./pathResolver.js"; import { pathToFileURL } from "url"; -export const DEV_PORT = 5173; +import { config } from 'dotenv'; + +// Load environment variables from .env file +config(); + +export const DEV_PORT = process.env.PORT ? parseInt(process.env.PORT) : 10087; // Checks if you are in development mode export function isDev(): boolean {