mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-01-29 01:28:29 +00:00
fix displayname condition
This commit is contained in:
parent
8068dc2cbb
commit
03b0474a2c
|
@ -28,7 +28,7 @@ export const useMemberEventParser = (): MemberEventParser => {
|
||||||
|
|
||||||
const senderName = getMxIdLocalPart(senderId);
|
const senderName = getMxIdLocalPart(senderId);
|
||||||
const userName =
|
const userName =
|
||||||
content.displayname && typeof content.displayname === 'string'
|
typeof content.displayname === 'string'
|
||||||
? content.displayname || getMxIdLocalPart(userId)
|
? content.displayname || getMxIdLocalPart(userId)
|
||||||
: getMxIdLocalPart(userId);
|
: getMxIdLocalPart(userId);
|
||||||
|
|
||||||
|
@ -179,14 +179,14 @@ export const useMemberEventParser = (): MemberEventParser => {
|
||||||
|
|
||||||
if (content.displayname !== prevContent.displayname) {
|
if (content.displayname !== prevContent.displayname) {
|
||||||
const prevUserName =
|
const prevUserName =
|
||||||
prevContent.displayname && typeof prevContent.displayname === 'string'
|
typeof prevContent.displayname === 'string'
|
||||||
? prevContent.displayname || getMxIdLocalPart(userId)
|
? prevContent.displayname || getMxIdLocalPart(userId)
|
||||||
: getMxIdLocalPart(userId);
|
: getMxIdLocalPart(userId);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
icon: Icons.Mention,
|
icon: Icons.Mention,
|
||||||
body:
|
body:
|
||||||
content.displayname && typeof content.displayname === 'string' ? (
|
typeof content.displayname === 'string' ? (
|
||||||
<>
|
<>
|
||||||
<b>{prevUserName}</b>
|
<b>{prevUserName}</b>
|
||||||
{' changed display name to '}
|
{' changed display name to '}
|
||||||
|
|
Loading…
Reference in a new issue