From 7f2ac967ebc900e57b09bf4c945412e84943ebb2 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 8 Nov 2024 17:01:09 +0800 Subject: [PATCH] fix: reduce upgrade toast duration and disable prompt on nightly version, fixed 1450 Signed-off-by: Innei --- apps/renderer/src/initialize/migrates/index.ts | 5 ++++- apps/renderer/src/modules/upgrade/container.tsx | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/renderer/src/initialize/migrates/index.ts b/apps/renderer/src/initialize/migrates/index.ts index 7a6186059..a53756bbd 100644 --- a/apps/renderer/src/initialize/migrates/index.ts +++ b/apps/renderer/src/initialize/migrates/index.ts @@ -20,7 +20,10 @@ export const doMigration = async () => { } // NOTE: Add migration logic here + if (!APP_VERSION.includes("nightly")) { + window.__app_is_upgraded__ = true + } appLog(`Upgrade from ${lastVersion} to ${APP_VERSION}`) - window.__app_is_upgraded__ = true + localStorage.setItem(appVersionKey, APP_VERSION) } diff --git a/apps/renderer/src/modules/upgrade/container.tsx b/apps/renderer/src/modules/upgrade/container.tsx index 0dc374109..d1c256699 100644 --- a/apps/renderer/src/modules/upgrade/container.tsx +++ b/apps/renderer/src/modules/upgrade/container.tsx @@ -66,7 +66,8 @@ const AppNotificationContainer: FC = () => { , enjoy the new features! 🎉 , { - duration: 10e8, + closeButton: true, + duration: 5000, action: CHANGELOG_CONTENT ? { label: "What's new?",