Skip to content

Commit 924b9e9

Browse files
authored
Merge pull request #299 from FlowiseAI/bugfix/FollowUp-Prompt
Bugfix/follow up prompt parse error
2 parents 6695629 + c3e78e1 commit 924b9e9

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

dist/components/Bot.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Bot.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -773,18 +773,14 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
773773
}
774774

775775
if (data.followUpPrompts) {
776-
let followUpPrompts = data.followUpPrompts;
777-
if (typeof followUpPrompts === 'string') {
778-
followUpPrompts = JSON.parse(followUpPrompts);
779-
}
780776
setMessages((prevMessages) => {
781777
const allMessages = [...cloneDeep(prevMessages)];
782778
if (allMessages[allMessages.length - 1].type === 'userMessage') return allMessages;
783-
allMessages[allMessages.length - 1].followUpPrompts = followUpPrompts;
779+
allMessages[allMessages.length - 1].followUpPrompts = data.followUpPrompts;
784780
addChatMessage(allMessages);
785781
return allMessages;
786782
});
787-
setFollowUpPrompts(followUpPrompts);
783+
setFollowUpPrompts(JSON.parse(data.followUpPrompts));
788784
}
789785
};
790786

0 commit comments

Comments
 (0)