Skip to content

Commit 25e7352

Browse files
processing count update fix on cancel
1 parent 442960c commit 25e7352

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

frontend/src/components/Content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ const Content: React.FC<ContentProps> = ({
381381
setextractLoading(false);
382382
await postProcessing(userCredentials as UserCredentials, postProcessingTasks);
383383
});
384-
} else if (queueFiles && !queue.isEmpty()) {
384+
} else if (queueFiles && !queue.isEmpty()&&processingFilesCount<batchSize) {
385385
data = scheduleBatchWiseProcess(queue.items, true);
386386
Promise.allSettled(data).then(async (_) => {
387387
setextractLoading(false);

frontend/src/components/FileTable.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,13 @@ const FileTable = forwardRef<ChildRef, FileTableProps>((props, ref) => {
761761
return curfile;
762762
})
763763
);
764+
setProcessedCount((prev) => {
765+
if (prev == batchSize) {
766+
return batchSize - 1;
767+
}
768+
return prev + 1;
769+
});
770+
queue.remove(fileName)
764771
} else {
765772
let errorobj = { error: res.data.error, message: res.data.message, fileName };
766773
throw new Error(JSON.stringify(errorobj));

frontend/src/hooks/useSse.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function useServerSideEvent(
4545
});
4646
});
4747
}
48-
} else if (status === 'Completed' || status === 'Cancelled') {
48+
} else if (status === 'Completed') {
4949
setFilesData((prevfiles) => {
5050
return prevfiles.map((curfile) => {
5151
if (curfile.name == fileName) {

0 commit comments

Comments
 (0)