From 0963d06af40e0402ff86ab51566fba42cfac4e06 Mon Sep 17 00:00:00 2001 From: dxty522 <261609953+dxty522@users.noreply.github.com> Date: Sat, 14 Feb 2026 14:17:42 +0100 Subject: [PATCH] fix: replace default dialog with notification Signed-off-by: dxty522 <261609953+dxty522@users.noreply.github.com> --- src/main.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 5256d5f..d67c18c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ -import { updateElectronApp } from "update-electron-app"; +import { IUpdateInfo, updateElectronApp } from "update-electron-app"; -import { BrowserWindow, app, shell } from "electron"; +import { BrowserWindow, app, shell, Notification } from "electron"; import started from "electron-squirrel-startup"; import { autoLaunch } from "./native/autoLaunch"; @@ -24,9 +24,19 @@ if (!config.hardwareAcceleration) { // ensure only one copy of the application can run 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 + }) + + notification.show() +} + if (acquiredLock) { // start auto update logic - updateElectronApp(); + updateElectronApp({onNotifyUser}) // create and configure the app when electron is ready app.on("ready", () => {