Merge branch 'stoatchat:main' into feat/minimise-to-tray-startup
This commit is contained in:
commit
3189a6c30e
|
|
@ -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: [
|
||||
|
|
|
|||
16
src/main.ts
16
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", () => {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue