feat: allow only a single instance

This commit is contained in:
leukipp
2024-12-17 21:54:49 +01:00
parent 99d3eea20d
commit 926bcdfab8
2 changed files with 18 additions and 5 deletions
+5
View File
@@ -13,6 +13,11 @@ const { app } = require("electron");
* initialization tasks.
*/
app.whenReady().then(async () => {
const lock = app.requestSingleInstanceLock();
if (!lock) {
console.error("TouchKio is already running");
return app.quit();
}
let args = parseArgs(process);
let argsProvided = !!Object.keys(args).length;