Skip to content

Build your personal knowledge base with Trilium Notes

fix(electron): port-in-use dialog shown when opening a new window

SiriusXTf3f07cdd28f2
diff --git a/apps/server/src/www.ts b/apps/server/src/www.ts
index 4149d518bb..130d3a380a 100644
--- a/apps/server/src/www.ts
+++ b/apps/server/src/www.ts
@@ -160,11 +160,10 @@ function startHttpServer(app: Express) {
// should simply focus on the existing window or open a new one, without displaying an error message.
if ("code" in error && error.code === "EADDRINUSE" && (process.argv.includes("--new-window") || !app.requestSingleInstanceLock())) {
console.error(message);
- process.exit(1);
} else {
dialog.showErrorBox("Error while initializing the server", message);
- process.exit(1);
}
+ process.exit(1);
});
} else {
console.error(message);