mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 16:45:53 +02:00
chore(server): fix error in Electron port handling
This commit is contained in:
@@ -158,11 +158,13 @@ function startHttpServer(app: Express) {
|
||||
}
|
||||
|
||||
if (utils.isElectron()) {
|
||||
if ("code" in error && error.code === "EADDRINUSE" && (process.argv.includes("--new-window") || !app.requestSingleInstanceLock())) {
|
||||
console.error(message);
|
||||
} else {
|
||||
getPlatform().crash(`Error while initializing the server: ${message}`);
|
||||
}
|
||||
import("electron").then(({ app }) => {
|
||||
if ("code" in error && error.code === "EADDRINUSE" && (process.argv.includes("--new-window") || !app.requestSingleInstanceLock())) {
|
||||
console.error(message);
|
||||
} else {
|
||||
getPlatform().crash(`Error while initializing the server: ${message}`);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getPlatform().crash(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user