Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit c825e34

Browse files
authored
Fix EventTile avatars being rendered with a size of 0 instead of hidden (#11558)
1 parent f4dc264 commit c825e34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/views/rooms/EventTile.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
10031003

10041004
let avatar: JSX.Element | null = null;
10051005
let sender: JSX.Element | null = null;
1006-
let avatarSize: string;
1006+
let avatarSize: string | null;
10071007
let needsSenderProfile: boolean;
10081008

10091009
if (isRenderingNotification) {
@@ -1021,7 +1021,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
10211021
avatarSize = "32px";
10221022
needsSenderProfile = true;
10231023
} else if (eventType === EventType.RoomCreate || isBubbleMessage) {
1024-
avatarSize = "0";
1024+
avatarSize = null;
10251025
needsSenderProfile = false;
10261026
} else if (this.props.layout == Layout.IRC) {
10271027
avatarSize = "14px";
@@ -1032,14 +1032,14 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
10321032
ElementCall.CALL_EVENT_TYPE.matches(eventType)
10331033
) {
10341034
// no avatar or sender profile for continuation messages and call tiles
1035-
avatarSize = "0";
1035+
avatarSize = null;
10361036
needsSenderProfile = false;
10371037
} else {
10381038
avatarSize = "30px";
10391039
needsSenderProfile = true;
10401040
}
10411041

1042-
if (this.props.mxEvent.sender && avatarSize) {
1042+
if (this.props.mxEvent.sender && avatarSize !== null) {
10431043
let member: RoomMember | null = null;
10441044
// set member to receiver (target) if it is a 3PID invite
10451045
// so that the correct avatar is shown as the text is

0 commit comments

Comments
 (0)