From 03b0474a2c274b846b1661d496acd7bb73d446ba Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sun, 26 Jan 2025 16:14:09 +0530 Subject: [PATCH] fix displayname condition --- src/app/hooks/useMemberEventParser.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/hooks/useMemberEventParser.tsx b/src/app/hooks/useMemberEventParser.tsx index f17fb45c..8a59aaad 100644 --- a/src/app/hooks/useMemberEventParser.tsx +++ b/src/app/hooks/useMemberEventParser.tsx @@ -28,7 +28,7 @@ export const useMemberEventParser = (): MemberEventParser => { const senderName = getMxIdLocalPart(senderId); const userName = - content.displayname && typeof content.displayname === 'string' + typeof content.displayname === 'string' ? content.displayname || getMxIdLocalPart(userId) : getMxIdLocalPart(userId); @@ -179,14 +179,14 @@ export const useMemberEventParser = (): MemberEventParser => { if (content.displayname !== prevContent.displayname) { const prevUserName = - prevContent.displayname && typeof prevContent.displayname === 'string' + typeof prevContent.displayname === 'string' ? prevContent.displayname || getMxIdLocalPart(userId) : getMxIdLocalPart(userId); return { icon: Icons.Mention, body: - content.displayname && typeof content.displayname === 'string' ? ( + typeof content.displayname === 'string' ? ( <> {prevUserName} {' changed display name to '}