mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 02:05:53 +01:00
refactor(server/utils): isElectron - replace fn with boolean
this values 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:
@@ -53,7 +53,7 @@ async function startTrilium() {
|
||||
* its startup is slower than focusing the existing process/window. So in the end, it works out without having
|
||||
* to do a complex evaluation.
|
||||
*/
|
||||
if (utils.isElectron()) {
|
||||
if (utils.isElectron) {
|
||||
(await import("electron")).app.requestSingleInstanceLock();
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ async function startTrilium() {
|
||||
|
||||
ws.init(httpServer, sessionParser as any); // TODO: Not sure why session parser is incompatible.
|
||||
|
||||
if (utils.isElectron()) {
|
||||
if (utils.isElectron) {
|
||||
const electronRouting = await import("./routes/electron.js");
|
||||
electronRouting.default(app);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ function startHttpServer() {
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isElectron()) {
|
||||
if (utils.isElectron) {
|
||||
import("electron").then(({ app, dialog }) => {
|
||||
// Not all situations require showing an error dialog. When Trilium is already open,
|
||||
// clicking the shortcut, the software icon, or the taskbar icon, or when creating a new window,
|
||||
|
||||
Reference in New Issue
Block a user