From 03b352bc157a2f1584d56543ff010ae729f07c70 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Tue, 23 Jan 2024 13:28:35 +0100 Subject: [PATCH] allow only a single instance --- main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.js b/main.js index d05f977..10cd355 100644 --- a/main.js +++ b/main.js @@ -537,6 +537,12 @@ function registerIPCPipes() { } function createWindow() { + const gotTheLock = app.requestSingleInstanceLock(); + if (!gotTheLock) { + app.quit(); + return; + } + setupTitlebar(); // Create the browser window.