From 78b59349ad1ade7ab571e67ec067044481e29dea Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:22:56 +1100 Subject: [PATCH] fix(updater): resurface dismissed update prompts --- electron/main.ts | 2 +- electron/updater.ts | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/electron/main.ts b/electron/main.ts index 90fed640..b91ef168 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -357,7 +357,7 @@ ipcMain.handle("defer-downloaded-update", (_event, delayMs?: number) => { }); ipcMain.handle("dismiss-update-toast", () => { - return dismissUpdateToast(sendUpdateToastToWindows); + return dismissUpdateToast(getUpdateDialogWindow, sendUpdateToastToWindows); }); ipcMain.handle("skip-update-version", () => { diff --git a/electron/updater.ts b/electron/updater.ts index b8072488..f383d876 100644 --- a/electron/updater.ts +++ b/electron/updater.ts @@ -4,6 +4,7 @@ import type { MessageBoxOptions, MessageBoxReturnValue } from "electron"; const UPDATE_CHECK_INTERVAL_MS = 6 * 60 * 60 * 1000; export const UPDATE_REMINDER_DELAY_MS = 3 * 60 * 60 * 1000; +const DISMISSED_READY_REMINDER_DELAY_MS = 5 * 60 * 1000; const AUTO_UPDATES_DISABLED = process.env.RECORDLY_DISABLE_AUTO_UPDATES === "1"; const DEV_UPDATE_PREVIEW_INTERVAL_MS = 10 * 1000; @@ -177,9 +178,32 @@ function scheduleDevUpdatePreview(sendToRenderer: UpdateToastSender) { }, DEV_UPDATE_PREVIEW_INTERVAL_MS); } -export function dismissUpdateToast(sendToRenderer?: UpdateToastSender) { + +export function dismissUpdateToast( + getMainWindow: () => BrowserWindow | null, + sendToRenderer?: UpdateToastSender, +) { + if (currentToastPayload?.isPreview) { + clearVisibleUpdateToast(sendToRenderer); + return { success: true }; + } + if (downloadInProgress) { downloadToastDismissed = true; + clearVisibleUpdateToast(sendToRenderer); + return { success: true }; + } + + if (currentToastPayload?.phase === "ready") { + return deferUpdateReminder( + getMainWindow, + sendToRenderer, + DISMISSED_READY_REMINDER_DELAY_MS, + ); + } + + if (currentToastPayload?.phase === "available" || currentToastPayload?.phase === "error") { + return deferUpdateReminder(getMainWindow, sendToRenderer, UPDATE_REMINDER_DELAY_MS); } clearVisibleUpdateToast(sendToRenderer);