Skip to content

Commit 8b6a9c6

Browse files
committed
Bug | Handling error when prompt template is not loaded
1 parent f446bf5 commit 8b6a9c6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/components/map-projects/MapProject.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,12 @@ const MapProject = () => {
25422542
}
25432543
let _candidates = flatten(map(selectedAlgoIds, algoId => find(allCandidatesRef.current[algoId], c => c.row?.__index === __index)?.results || []))
25442544
if(isNumber(__index) && repoVersion && !analysis[__index] && _candidates?.length > 0) {
2545+
if(!promptTemplate?.key) {
2546+
setAlert({message: 'AI Assistant prompt template is not available', severity: 'error'})
2547+
markAlgo(__index, 'recommend', -3)
2548+
return false
2549+
}
2550+
25452551
markAlgo(__index, 'recommend', 0)
25462552
let rowData = prepareRow(__row, true, true)
25472553
const payload = {

0 commit comments

Comments
 (0)