fix: 模板信息显示

dev/mobile
Lei OT 2 years ago
parent 707cc505de
commit a3345af4a6

@ -37,9 +37,9 @@ const MessagesList = ({ messages, handlePreview, reference, longListLoading, get
let headerObj, footerObj, buttonsArr;
if (!isEmpty(template)) {
const componentsObj = groupBy(template.components, (item) => item.type);
headerObj = componentsObj.header[0];
footerObj = componentsObj.footer[0];
buttonsArr = componentsObj.buttons.reduce((r, c) => r.concat(c.buttons), []);
headerObj = componentsObj?.header?.[0];
footerObj = componentsObj?.footer?.[0];
buttonsArr = componentsObj?.buttons?.reduce((r, c) => r.concat(c.buttons), []);
}
const parts = str.split(/(https?:\/\/[^\s]+|\p{Emoji_Presentation})/gmu).filter((s) => s !== '');

Loading…
Cancel
Save