fix displayname condition

This commit is contained in:
Ajay Bura 2025-01-26 16:14:09 +05:30
parent 8068dc2cbb
commit 03b0474a2c

View file

@ -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' ? (
<>
<b>{prevUserName}</b>
{' changed display name to '}