refactor: move development mode detection to the top of main.js

This commit is contained in:
2026-04-23 04:41:33 +10:00
parent 8a95d9e67d
commit d0524c2bc7
2 changed files with 6 additions and 6 deletions

2
cinny

Submodule cinny updated: e5e296ca98...114435a56d

View File

@@ -16,6 +16,11 @@ if (require('electron-squirrel-startup')) {
app.quit(); app.quit();
} }
// Development mode detection - MUST be declared before any code that might use it
const isDev = process.env.NODE_ENV === 'development' || !app.isPackaged;
const VITE_DEV_SERVER = 'http://localhost:38347';
const PORT = 44548;
// Handle Squirrel.Windows installation/update events // Handle Squirrel.Windows installation/update events
if (process.platform === 'win32') { if (process.platform === 'win32') {
const handleSquirrelEvent = () => { const handleSquirrelEvent = () => {
@@ -170,11 +175,6 @@ if (!gotTheLock) {
}); });
} }
// Development mode detection
const isDev = process.env.NODE_ENV === 'development' || !app.isPackaged;
const VITE_DEV_SERVER = 'http://localhost:38347';
const PORT = 44548;
// Helper to get correct icon path in dev vs packaged app // Helper to get correct icon path in dev vs packaged app
function getIconPath(iconName) { function getIconPath(iconName) {
if (isDev) { if (isDev) {