From eeae431e79d2dac15d68aa9e08417aed05522338 Mon Sep 17 00:00:00 2001
From: cupcakearmy <hi@nicco.io>
Date: Wed, 7 Apr 2021 10:25:31 +0200
Subject: [PATCH] run maximal one instance

---
 src/back/index.ts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/back/index.ts b/src/back/index.ts
index 0b10a2d..00a93df 100644
--- a/src/back/index.ts
+++ b/src/back/index.ts
@@ -8,6 +8,12 @@ import Updater from './updater'
 
 export const DEV = !app.isPackaged
 
+// Enforce single instance
+const isMain = app.requestSingleInstanceLock()
+if (!isMain) {
+  app.quit()
+}
+
 // Disable gpu
 app.disableHardwareAcceleration()
 app.commandLine.appendSwitch('disable-software-rasterizer')