Fix export issues (#999)

This commit is contained in:
Abhinav Kumar 2023-03-29 20:44:14 +05:30 committed by GitHub
commit 55d45b0457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,6 +81,9 @@ export default function ExportModal(props: Props) {
if (!props.show) {
return;
}
if (exportService.isExportInProgress()) {
setExportStage(ExportStage.INPROGRESS);
}
syncFileCounts();
}, [props.show]);
@ -102,15 +105,15 @@ export default function ExportModal(props: Props) {
}
const main = async () => {
try {
const exportInfo = await exportService.getExportRecord();
if (exportInfo?.stage) {
setExportStage(exportInfo?.stage);
}
if (exportInfo?.lastAttemptTimestamp) {
setLastExportTime(exportInfo?.lastAttemptTimestamp);
const exportRecord = await exportService.getExportRecord();
if (!exportRecord) {
setExportStage(ExportStage.INIT);
return;
}
setExportStage(exportRecord.stage);
setLastExportTime(exportRecord.lastAttemptTimestamp);
await syncFileCounts();
if (exportInfo?.stage === ExportStage.INPROGRESS) {
if (exportRecord.stage === ExportStage.INPROGRESS) {
await startExport();
}
} catch (e) {