fix continuous export run incorrect pending file count

This commit is contained in:
Abhinav 2023-03-27 21:26:27 +05:30
parent 3404713501
commit 5adf4bbb5b

View file

@ -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();