From c10caf8d7f1f9cf68551e41de5d54cd4450cf44a Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 5 Aug 2024 11:43:15 +0700 Subject: [PATCH] chore: check the legacy incompatible message type (#3248) --- .../Thread/ThreadCenterPanel/SimpleTextMessage/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/screens/Thread/ThreadCenterPanel/SimpleTextMessage/index.tsx b/web/screens/Thread/ThreadCenterPanel/SimpleTextMessage/index.tsx index 293c07e03..e4b36fa9c 100644 --- a/web/screens/Thread/ThreadCenterPanel/SimpleTextMessage/index.tsx +++ b/web/screens/Thread/ThreadCenterPanel/SimpleTextMessage/index.tsx @@ -61,7 +61,9 @@ const SimpleTextMessage: React.FC = ({ const message = msg.content[0] if (message && message.type === 'text') { const textBlockContent = message as TextContentBlock - setText(textBlockContent.text.value) + // Check for compatible message object type - There was a problem with legacy message object compatibility, which broke the app. + if (typeof textBlockContent.text.value === 'string') + setText(textBlockContent.text.value) } } }, [msg.content])