Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix(MinimizedUploadProgress):showing-prev-upload-values

Aswin Asok4a9e3cd306b5
diff --git a/web/packages/gallery/components/upload-progress-v2/MinimizedUploadProgress.tsx b/web/packages/gallery/components/upload-progress-v2/MinimizedUploadProgress.tsx
index 46764781b6..f64f79e416 100644
--- a/web/packages/gallery/components/upload-progress-v2/MinimizedUploadProgress.tsx
+++ b/web/packages/gallery/components/upload-progress-v2/MinimizedUploadProgress.tsx
@@ -30,6 +30,7 @@ export function MinimizedUploadProgress() {
const { dragPosition, dragHandleProps } =
useMinimizedUploadDrag(dragSurfaceRef);
const progress = normalizePercent(percentComplete);
+ const showUploadProgress = context.uploadPhase == "uploading";
const setDragSurface = (surface: HTMLDivElement | null) => {
dragSurfaceRef.current = surface;
@@ -62,16 +63,16 @@ export function MinimizedUploadProgress() {
</Box>
<Stack sx={{ flex: 1, minWidth: 0, gap: 0.5 }}>
<Typography sx={minimizedTitleSx}>
- {context.uploadPhase == "cancelling"
- ? t("file_upload")
+ {showUploadProgress
+ ? `${progress.toLocaleString()}% uploaded`
: context.uploadPhase == "done"
? uploadStatusText(context.uploadPhase)
- : `${progress.toLocaleString()}% uploaded`}
+ : t("file_upload")}
</Typography>
<Typography sx={minimizedSubtitleSx}>
- {context.uploadPhase == "cancelling"
- ? uploadStatusText(context.uploadPhase)
- : uploadCountsText(context)}
+ {showUploadProgress || context.uploadPhase == "done"
+ ? uploadCountsText(context)
+ : uploadStatusText(context.uploadPhase)}
</Typography>
</Stack>
<IconButton