From 38556fc504168c5135571840e4a0d1d6ef99ace1 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Mon, 7 Jul 2025 06:44:15 +0400 Subject: [PATCH] style: copy and minor self-update modal logic change --- src/components/app-update-toast.tsx | 69 ++++++++++++++-------- src/components/create-profile-dialog.tsx | 7 +++ src/components/custom-toast.tsx | 51 +++++++++++----- src/hooks/use-app-update-notifications.tsx | 2 +- 4 files changed, 86 insertions(+), 43 deletions(-) diff --git a/src/components/app-update-toast.tsx b/src/components/app-update-toast.tsx index b7f015c..21b14a3 100644 --- a/src/components/app-update-toast.tsx +++ b/src/components/app-update-toast.tsx @@ -65,11 +65,18 @@ export function AppUpdateToast({ await onUpdate(updateInfo); }; - const showProgress = + const showDownloadProgress = isUpdating && updateProgress?.stage === "downloading" && updateProgress.percentage !== undefined; + const showOtherStageProgress = + isUpdating && + updateProgress && + (updateProgress.stage === "extracting" || + updateProgress.stage === "installing" || + updateProgress.stage === "completed"); + return (
@@ -117,7 +124,7 @@ export function AppUpdateToast({
{/* Download progress */} - {showProgress && updateProgress && ( + {showDownloadProgress && updateProgress && (

@@ -135,31 +142,41 @@ export function AppUpdateToast({

)} - {/* Other stage progress (without percentage) */} - {isUpdating && - updateProgress && - updateProgress.stage !== "downloading" && ( -
-

- {updateProgress.message} -

- {updateProgress.stage === "extracting" && ( -

- Preparing update files... -

- )} - {updateProgress.stage === "installing" && ( -

- Installing new version... -

- )} - {updateProgress.stage === "completed" && ( -

- Update completed! Restarting application... -

- )} + {/* Other stage progress (with visual indicators) */} + {showOtherStageProgress && ( +
+

+ {updateProgress.message} +

+ + {/* Progress indicator for non-downloading stages */} +
+
- )} + + {updateProgress.stage === "extracting" && ( +

+ Preparing update files... +

+ )} + {updateProgress.stage === "installing" && ( +

+ Installing new version... +

+ )} + {updateProgress.stage === "completed" && ( +

+ Update completed! Restarting application... +

+ )} +
+ )} {!isUpdating && (
diff --git a/src/components/create-profile-dialog.tsx b/src/components/create-profile-dialog.tsx index 8cabb2a..763a8fc 100644 --- a/src/components/create-profile-dialog.tsx +++ b/src/components/create-profile-dialog.tsx @@ -327,6 +327,13 @@ export function CreateProfileDialog({
+ {/* Anti-Detect Description */} +
+

+ Powered by Camoufox +

+
+ {/* Profile Name - Common to both tabs */}
diff --git a/src/components/custom-toast.tsx b/src/components/custom-toast.tsx index efcdbb3..94bcf7c 100644 --- a/src/components/custom-toast.tsx +++ b/src/components/custom-toast.tsx @@ -240,26 +240,45 @@ export function UnifiedToast(props: ToastProps) { )} {/* App update progress */} - {type === "app-update" && - progress && - "percentage" in progress && - stage === "downloading" && ( -
-
-

- {progress.percentage.toFixed(1)}% - {progress.speed && ` • ${progress.speed} MB/s`} - {progress.eta && ` • ${progress.eta} remaining`} -

-
+ {type === "app-update" && ( +
+ {/* Download progress with percentage */} + {progress && + "percentage" in progress && + stage === "downloading" && ( + <> +
+

+ {progress.percentage.toFixed(1)}% + {progress.speed && ` • ${progress.speed} MB/s`} + {progress.eta && ` • ${progress.eta} remaining`} +

+
+
+
+
+ + )} + + {/* Progress indicator for other stages */} + {(stage === "extracting" || + stage === "installing" || + stage === "completed") && (
-
- )} + )} +
+ )} {/* Version update progress */} {type === "version-update" && diff --git a/src/hooks/use-app-update-notifications.tsx b/src/hooks/use-app-update-notifications.tsx index 699ee34..dd10b2b 100644 --- a/src/hooks/use-app-update-notifications.tsx +++ b/src/hooks/use-app-update-notifications.tsx @@ -120,7 +120,7 @@ export function useAppUpdateNotifications() { setTimeout(() => { setIsUpdating(false); setUpdateProgress(null); - }, 2000); + }, 5000); // Show completion message for 5 seconds instead of 2 } }, );