From 4e44407529f8e83966973b718283a7bcb6fbf0b1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 6 Sep 2023 20:55:24 +0100 Subject: [PATCH] Fix EventTile avatars being rendered with a size of 0 instead of hidden (#11558) (cherry picked from commit c825e34f16fa7becdbbf14b98b7bdfc879dbc7a5) --- src/components/views/rooms/EventTile.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 986eafcca9c..77fb270768f 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -1003,7 +1003,7 @@ export class UnwrappedEventTile extends React.Component let avatar: JSX.Element | null = null; let sender: JSX.Element | null = null; - let avatarSize: string; + let avatarSize: string | null; let needsSenderProfile: boolean; if (isRenderingNotification) { @@ -1021,7 +1021,7 @@ export class UnwrappedEventTile extends React.Component avatarSize = "32px"; needsSenderProfile = true; } else if (eventType === EventType.RoomCreate || isBubbleMessage) { - avatarSize = "0"; + avatarSize = null; needsSenderProfile = false; } else if (this.props.layout == Layout.IRC) { avatarSize = "14px"; @@ -1032,14 +1032,14 @@ export class UnwrappedEventTile extends React.Component ElementCall.CALL_EVENT_TYPE.matches(eventType) ) { // no avatar or sender profile for continuation messages and call tiles - avatarSize = "0"; + avatarSize = null; needsSenderProfile = false; } else { avatarSize = "30px"; needsSenderProfile = true; } - if (this.props.mxEvent.sender && avatarSize) { + if (this.props.mxEvent.sender && avatarSize !== null) { let member: RoomMember | null = null; // set member to receiver (target) if it is a 3PID invite // so that the correct avatar is shown as the text is