Skip to content

Commit cfc7d59

Browse files
committed
OpenConceptLab/ocl_online#6 | Bulk AI Assistant | using same rows from auto match
1 parent 47fa2f2 commit cfc7d59

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/map-projects/MapProject.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -875,16 +875,15 @@ const MapProject = () => {
875875
setEndMatchingAt(moment())
876876
setLoadingMatches(false)
877877
if(inAIAssistantGroup)
878-
setTimeout(runBulkAIAnalysis, 1000)
878+
setTimeout(() => runBulkAIAnalysis(rows), 1000)
879879
};
880880

881-
const runBulkAIAnalysis = async () => {
881+
const runBulkAIAnalysis = async (_rows) => {
882882
setBulkAIAnalysisStartedAt(moment())
883-
for (let index = 0; index < rows.length; index++) {
883+
for (let index = 0; index < _rows.length; index++) {
884884
if (abortRef.current) break;
885885

886-
const row = rows[index];
887-
await fetchRecommendation(row); // wait for completion
886+
await fetchRecommendation(_rows[index]); // wait for completion
888887
await new Promise(resolve => setTimeout(resolve, 15000)); // 15s delay
889888
}
890889

@@ -996,6 +995,8 @@ const MapProject = () => {
996995
setAlert(false)
997996
if(isAnyValidColumn()){
998997
setStartMatchingAt(moment())
998+
setBulkAIAnalysisStartedAt(null)
999+
setBulkAIAnalysisEndedAt(null)
9991000
setLoadingMatches(true)
10001001
getRowsResults(data)
10011002
} else {

0 commit comments

Comments
 (0)