From f9b7a9739fb762d42a44c852e65317ec0c054971 Mon Sep 17 00:00:00 2001 From: MiTHRAL Date: Tue, 21 Apr 2026 15:35:40 -0400 Subject: [PATCH] feat: add Check for Updates to tray menu Co-Authored-By: Claude Sonnet 4.6 --- src/native/tray.ts | 6 ++++++ src/native/updater.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/native/tray.ts b/src/native/tray.ts index b157cf1..710c3a7 100644 --- a/src/native/tray.ts +++ b/src/native/tray.ts @@ -5,6 +5,7 @@ import macOsTrayIconAsset from "../../assets/desktop/iconTemplate.png?asset"; import { version } from "../../package.json"; import { mainWindow, quitApp } from "./window"; +import { checkForUpdates } from "./updater"; // internal tray state let tray: Tray = null; @@ -52,6 +53,11 @@ export function updateTrayMenu() { }, ]), }, + { + label: "Check for Updates", + type: "normal", + click: () => checkForUpdates(), + }, { type: "separator" }, { label: mainWindow.isVisible() ? "Hide App" : "Show App", diff --git a/src/native/updater.ts b/src/native/updater.ts index 2e17ba7..78103a6 100644 --- a/src/native/updater.ts +++ b/src/native/updater.ts @@ -1,4 +1,4 @@ -import { Notification, app } from "electron"; +import { Notification, app, ipcMain } from "electron"; import { exec } from "child_process"; import { createWriteStream, mkdirSync } from "fs"; import { dirname, join } from "path"; @@ -6,6 +6,8 @@ import { tmpdir } from "os"; import { pipeline } from "stream/promises"; import { Readable } from "stream"; +ipcMain.handle("checkForUpdates", () => checkForUpdates()); + const RELEASES_URL = "https://git.mithraic.cloud/api/v1/repos/ad3laid3/sanctum/releases/latest";