From 433e1b10b6d364942ff23c86387d7672ea715a60 Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Tue, 7 Oct 2025 22:28:51 +0530 Subject: [PATCH] refactor: improved update popup --- src/components/sidebar.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/sidebar.tsx b/src/components/sidebar.tsx index 9b407ea..9bf83e1 100644 --- a/src/components/sidebar.tsx +++ b/src/components/sidebar.tsx @@ -14,10 +14,10 @@ import { Button } from "@/components/ui/button"; import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"; import { Progress } from "@/components/ui/progress"; import useAppUpdater from "@/helpers/use-app-updater"; - + export function AppSidebar() { const downloadStates = useDownloadStatesStore(state => state.downloadStates); - const ongoingDownloads = downloadStates.filter(state => + const ongoingDownloads = downloadStates.filter(state => ['starting', 'downloading', 'queued'].includes(state.download_status) ); const appVersion = useSettingsPageStatesStore(state => state.appVersion); @@ -63,12 +63,12 @@ export function AppSidebar() { setShowBadge(false); setShowUpdateCard(false); } - + return () => { clearTimeout(timeout); }; }, [open]); - + return ( @@ -99,7 +99,7 @@ export function AppSidebar() { {!open ? ( - ) : ( - - Update Available (v{appUpdate.version}) + Update Available (v{appUpdate?.version || '0.0.0'}) A newer version of {config.appName} is available. Please update to the latest version for the best experience. - ✨ Read Changelog + ✨ Read Changelog @@ -169,13 +169,14 @@ export function AppSidebar() { disabled={ongoingDownloads.length > 0 || isUpdatingApp} onClick={() => downloadAndInstallAppUpdate(appUpdate)} > - Download and Install + Update Now + Updating {config.appName} - Updating {config.appName} to v{appUpdate.version}, Please be patience! Do not quit the app untill the update finishes. The app will auto re-launch to complete the update, Please allow all system prompts from {config.appName} if asked. + Updating {config.appName} to v{appUpdate?.version || '0.0.0'}, Please be patience! Do not quit the app untill the update finishes. The app will auto re-launch to complete the update, Please allow all system prompts from {config.appName} if asked. Downloading update... {appUpdateDownloadProgress}% @@ -221,4 +222,4 @@ export function AppSidebar() { ) -} \ No newline at end of file +}