Fix: Array message from typebot get only last one to show

This commit is contained in:
Douglas Rauber at Nitro 2023-12-19 16:31:41 -03:00
parent 380d6a43a5
commit 51ed67a53e

View File

@ -412,14 +412,17 @@ export class TypebotService {
let formattedText = '';
let linkPreview = false;
for (const richText of message.content.richText) {
if (richText.type === 'variable') {
for (const child of richText.children) {
for (const grandChild of child.children) {
if (grandChild.text.startsWith('[') && grandChild.text.endsWith(']')) {
formattedText += JSON.parse(grandChild.text).slice(-1)[0];
} else {
formattedText += grandChild.text;
}
}
}
} else {
for (const element of richText.children) {
let text = '';