refactor: move development mode detection to the top of main.js
This commit is contained in:
2
cinny
2
cinny
Submodule cinny updated: e5e296ca98...114435a56d
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user