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 () => {
|
const postExportRun = async () => {
|
||||||
await updateExportStage(ExportStage.FINISHED);
|
await updateExportStage(ExportStage.FINISHED);
|
||||||
await updateExportTime(Date.now());
|
await updateExportTime(Date.now());
|
||||||
syncFileCounts();
|
await syncFileCounts();
|
||||||
};
|
};
|
||||||
|
|
||||||
const syncFileCounts = async () => {
|
const syncFileCounts = async () => {
|
||||||
|
@ -175,6 +175,10 @@ export default function ExportModal(props: Props) {
|
||||||
);
|
);
|
||||||
setTotalFileCount(userPersonalFiles.length);
|
setTotalFileCount(userPersonalFiles.length);
|
||||||
setPendingFileCount(unExportedFiles.length);
|
setPendingFileCount(unExportedFiles.length);
|
||||||
|
return {
|
||||||
|
totalFileCount: userPersonalFiles.length,
|
||||||
|
pendingFileCount: unExportedFiles.length,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// =============
|
// =============
|
||||||
|
@ -200,6 +204,7 @@ export default function ExportModal(props: Props) {
|
||||||
const startExport = async () => {
|
const startExport = async () => {
|
||||||
try {
|
try {
|
||||||
await preExportRun();
|
await preExportRun();
|
||||||
|
const { pendingFileCount } = await syncFileCounts();
|
||||||
setExportProgress({ current: 0, total: pendingFileCount });
|
setExportProgress({ current: 0, total: pendingFileCount });
|
||||||
await exportService.exportFiles(setExportProgress);
|
await exportService.exportFiles(setExportProgress);
|
||||||
await postExportRun();
|
await postExportRun();
|
||||||
|
|
Loading…
Reference in a new issue