From 5adf4bbb5b1d6f1d40f22b16de452cb85cec2c59 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Mon, 27 Mar 2023 21:26:27 +0530 Subject: [PATCH] fix continuous export run incorrect pending file count --- src/components/ExportModal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ExportModal.tsx b/src/components/ExportModal.tsx index 01e327e8d..187b06a6d 100644 --- a/src/components/ExportModal.tsx +++ b/src/components/ExportModal.tsx @@ -163,7 +163,7 @@ export default function ExportModal(props: Props) { const postExportRun = async () => { await updateExportStage(ExportStage.FINISHED); await updateExportTime(Date.now()); - syncFileCounts(); + await syncFileCounts(); }; const syncFileCounts = async () => { @@ -175,6 +175,10 @@ export default function ExportModal(props: Props) { ); setTotalFileCount(userPersonalFiles.length); setPendingFileCount(unExportedFiles.length); + return { + totalFileCount: userPersonalFiles.length, + pendingFileCount: unExportedFiles.length, + }; }; // ============= @@ -200,6 +204,7 @@ export default function ExportModal(props: Props) { const startExport = async () => { try { await preExportRun(); + const { pendingFileCount } = await syncFileCounts(); setExportProgress({ current: 0, total: pendingFileCount }); await exportService.exportFiles(setExportProgress); await postExportRun();