We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cfdbd89 commit c323d78Copy full SHA for c323d78
code/frontend/src/components/Answer/AnswerParser.tsx
@@ -19,7 +19,7 @@ export function parseAnswer(answer: AskResponse): ParsedAnswer {
19
// Replacing the links/citations with number
20
let citationIndex = link.slice(lengthDocN, link.length - 1);
21
let citation = cloneDeep(answer.citations[Number(citationIndex) - 1]) as Citation;
22
- if (!filteredCitations.find((c) => c.id === citationIndex)) {
+ if (!filteredCitations.find((c) => c.id === citationIndex) && citation !== undefined) {
23
answerText = answerText.replaceAll(link, ` ^${++citationReindex}^ `);
24
citation.id = citationIndex; // original doc index to de-dupe
25
citation.reindex_id = citationReindex.toString(); // reindex from 1 for display
0 commit comments