From a82191a2a70051f37115a413c6386936f9ed49c9 Mon Sep 17 00:00:00 2001 From: StreetLamb Date: Mon, 22 Apr 2024 22:18:45 +0800 Subject: [PATCH] frontend: Fix MessageBox --- frontend/src/components/Teams/ChatTeam.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/Teams/ChatTeam.tsx b/frontend/src/components/Teams/ChatTeam.tsx index db8c944b..8af93849 100644 --- a/frontend/src/components/Teams/ChatTeam.tsx +++ b/frontend/src/components/Teams/ChatTeam.tsx @@ -84,20 +84,16 @@ const stream = async (id: number, data: TeamChat) => { } const MessageBox = ({ message }: { message: Message }) => { - const memberName = message.member.slice(0, message.member.lastIndexOf("-")) - const nextMemberName = - message.next?.lastIndexOf("-") !== -1 - ? message.next?.slice(0, message.next?.lastIndexOf("-")) - : message.next + const { member, next, content } = message return ( - {memberName} - {nextMemberName && } - {nextMemberName && nextMemberName} + {member} + {next && } + {next && next} - {message.content} + {content} )