refactor(server/utils): isDev move to utils and replace fn with boolean

this value cannot change during runtime,
=> there is no need to have these checks
as dynamic function, instead just
export the boolean value directly
This commit is contained in:
Panagiotis Papadopoulos
2025-01-22 19:08:38 +01:00
parent ca2bb94200
commit 31c46753de
9 changed files with 18 additions and 29 deletions

View File

@@ -2,7 +2,6 @@ import path from "path";
import url from "url";
import port from "./port.js";
import optionService from "./options.js";
import env from "./env.js";
import log from "./log.js";
import sqlInit from "./sql_init.js";
import cls from "./cls.js";
@@ -10,7 +9,7 @@ import keyboardActionsService from "./keyboard_actions.js";
import remoteMain from "@electron/remote/main/index.js";
import type { App, BrowserWindow, BrowserWindowConstructorOptions, WebContents } from "electron";
import { ipcMain } from "electron";
import { isMac, isWindows } from "./utils.js";
import { isDev, isMac, isWindows } from "./utils.js";
import { fileURLToPath } from "url";
import { dirname } from "path";
@@ -169,7 +168,7 @@ function configureWebContents(webContents: WebContents, spellcheckEnabled: boole
}
function getIcon() {
return path.join(dirname(fileURLToPath(import.meta.url)), "../../images/app-icons/png/256x256" + (env.isDev() ? "-dev" : "") + ".png");
return path.join(dirname(fileURLToPath(import.meta.url)), "../../images/app-icons/png/256x256" + (isDev ? "-dev" : "") + ".png");
}
async function createSetupWindow() {