From 63b9ea818a9f32ca8535948e18752726c0f50a12 Mon Sep 17 00:00:00 2001 From: Mihai <45673304+mihaicm93@users.noreply.github.com> Date: Wed, 18 Feb 2026 04:33:46 +0100 Subject: [PATCH] fix: firstLaunch = false after initial setup (#131) fix: don't re-enable abutostart Signed-off-by: Mihai Co-authored-by: Mihai --- src/main.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main.ts b/src/main.ts index d67c18c..911db87 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import { IUpdateInfo, updateElectronApp } from "update-electron-app"; -import { BrowserWindow, app, shell, Notification } from "electron"; +import { BrowserWindow, Notification, app, shell } from "electron"; import started from "electron-squirrel-startup"; import { autoLaunch } from "./native/autoLaunch"; @@ -26,29 +26,31 @@ const acquiredLock = app.requestSingleInstanceLock(); const onNotifyUser = (_info: IUpdateInfo) => { const notification = new Notification({ - title: 'Update Available', - body: 'Restart the app to install the update.', - silent: true - }) + title: "Update Available", + body: "Restart the app to install the update.", + silent: true, + }); - notification.show() -} + notification.show(); +}; if (acquiredLock) { // start auto update logic - updateElectronApp({onNotifyUser}) + updateElectronApp({ onNotifyUser }); // create and configure the app when electron is ready app.on("ready", () => { + // create window and application contexts + createMainWindow(); + // enable auto start on Windows and MacOS if (config.firstLaunch) { if (process.platform === "win32" || process.platform === "darwin") { autoLaunch.enable(); } + config.firstLaunch = false; } - // create window and application contexts - createMainWindow(); initTray(); initDiscordRpc();