From a3345af4a6371c01e3c50af48af9b34962a32639 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 25 Mar 2024 14:20:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E6=9D=BF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Conversations/Components/MessagesList.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/Conversations/Components/MessagesList.jsx b/src/views/Conversations/Components/MessagesList.jsx index a0df233..fdfeea0 100644 --- a/src/views/Conversations/Components/MessagesList.jsx +++ b/src/views/Conversations/Components/MessagesList.jsx @@ -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 !== '');