fix continuous export run incorrect pending file count
This commit is contained in:
parent
3404713501
commit
5adf4bbb5b
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue