Merge branch 'stoatchat:main' into feat/minimise-to-tray-startup

This commit is contained in:
Mihai 2026-02-17 21:12:04 +01:00 committed by GitHub
commit 3189a6c30e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 7 deletions

View File

@ -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: [

View File

@ -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", () => {

View File

@ -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();
}
});
}

View File

@ -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(