Skip to content

Commit 88ff031

Browse files
committed
OpenConceptLab/ocl_issues#2307 | saved algo to reflect on load
1 parent 78c8378 commit 88ff031

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/map-projects/MapProject.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ const MapProject = () => {
236236
const bridgeCandidatesRef = React.useRef([]);
237237
const scispacyCandidatesRef = React.useRef([]);
238238
const rowStageRef = React.useRef([]);
239+
const algoRef = React.useRef([]);
239240

240241
/*eslint no-undef: 0*/
241242
const AI_ASSISTANT_API_URL = window.AI_ASSISTANT_API_URL || process.env.AI_ASSISTANT_API_URL
@@ -921,7 +922,7 @@ const MapProject = () => {
921922
const isLLMAlgoAllowed = version?.match_algorithms?.includes('llm')
922923
newAlgos[1].disabled = !isLLMAlgoAllowed
923924
setAlgos(newAlgos)
924-
if(!isLLMAlgoAllowed && algo === 'llm') {
925+
if(!isLLMAlgoAllowed && algoRef.current === 'llm') {
925926
onAlgoSelect('es')
926927
}
927928
}
@@ -1194,6 +1195,9 @@ const MapProject = () => {
11941195
React.useEffect(() => {
11951196
rowStageRef.current = rowStage;
11961197
}, [rowStage]);
1198+
React.useEffect(() => {
1199+
algoRef.current = algo;
1200+
}, [algo]);
11971201

11981202
const runBulkAIAnalysis = async (_rows) => {
11991203
setLoadingMatches(true)

0 commit comments

Comments
 (0)