diff --git a/forge.config.ts b/forge.config.ts index 40952df..3323356 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -58,7 +58,7 @@ if (!process.env.PLATFORM) { description: STRINGS.description, productName: STRINGS.name, productDescription: STRINGS.description, - runtimeVersion: "21.08", + runtimeVersion: "25.08", icon: `${ASSET_DIR}/icon.png`, categories: ["Network"], modules: [ 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", () => { diff --git a/src/native/tray.ts b/src/native/tray.ts index 6f96a4e..219afde 100644 --- a/src/native/tray.ts +++ b/src/native/tray.ts @@ -28,8 +28,12 @@ export function initTray() { tray.setToolTip("Stoat for Desktop"); tray.setImage(trayIcon); tray.on("click", () => { - mainWindow.show(); - mainWindow.focus(); + if (mainWindow.isVisible()) { + mainWindow.hide(); + } else { + mainWindow.show(); + mainWindow.focus(); + } }); } diff --git a/src/native/window.ts b/src/native/window.ts index 26841a1..1cceb5c 100644 --- a/src/native/window.ts +++ b/src/native/window.ts @@ -120,7 +120,7 @@ export function createMainWindow() { // rebind zoom controls to be more sensible mainWindow.webContents.on("before-input-event", (event, input) => { - if (input.control && input.key === "=") { + if (input.control && (input.key === "=" || input.key === "+")) { // zoom in (+) event.preventDefault(); mainWindow.webContents.setZoomLevel(