mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 23:05:51 +01:00
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:
@@ -1,5 +1,5 @@
|
||||
import { WebSocketServer as WebSocketServer, WebSocket } from "ws";
|
||||
import { isElectron, randomString } from "./utils.js";
|
||||
import { isDev, isElectron, randomString } from "./utils.js";
|
||||
import log from "./log.js";
|
||||
import sql from "./sql.js";
|
||||
import cls from "./cls.js";
|
||||
@@ -9,11 +9,10 @@ import protectedSessionService from "./protected_session.js";
|
||||
import becca from "../becca/becca.js";
|
||||
import AbstractBeccaEntity from "../becca/entities/abstract_becca_entity.js";
|
||||
|
||||
import env from "./env.js";
|
||||
import type { IncomingMessage, Server as HttpServer } from "http";
|
||||
import type { EntityChange } from "./entity_changes_interface.js";
|
||||
|
||||
if (env.isDev()) {
|
||||
if (isDev) {
|
||||
const chokidar = (await import("chokidar")).default;
|
||||
const debounce = (await import("debounce")).default;
|
||||
const debouncedReloadFrontend = debounce(() => reloadFrontend("source code change"), 200);
|
||||
|
||||
Reference in New Issue
Block a user