From 7d2f296ca72bbd7ad694c66a917d47067f883fc5 Mon Sep 17 00:00:00 2001 From: dxty522 <261609953+dxty522@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:05:26 +0100 Subject: [PATCH] fix: replace default dialog with notification (#98) 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", () => {