Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(Export):mid-export-mount-state-sync-fixed

Aswin Asokd475a395aee6
diff --git a/web/packages/new/photos/components/Export.tsx b/web/packages/new/photos/components/Export.tsx
index f936563fa5..0cfb77a3bf 100644
--- a/web/packages/new/photos/components/Export.tsx
+++ b/web/packages/new/photos/components/Export.tsx
@@ -130,6 +130,20 @@ export const Export: React.FC<ExportProps> = ({
void syncExportRecord(exportFolder);
}, [open, exportFolder, syncExportRecord]);
+ useEffect(() => {
+ if (!exportService.isExportInProgress()) return;
+
+ // If the dialog mounts mid-export, the stage can lag behind progress.
+ const processed = exportProgress.success + exportProgress.failed;
+ if (
+ exportStage < ExportStage.exportingFiles &&
+ exportProgress.total > 0 &&
+ processed > 0
+ ) {
+ setExportStage(ExportStage.exportingFiles);
+ }
+ }, [exportProgress, exportStage, exportService]);
+
const verifyExportFolderExists = useCallback(async () => {
if (!(await exportService.exportFolderExists(exportFolder))) {
showMiniDialog({