1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-14 19:02:33 +03:00

Merge pull request #4953 from matrix-org/t3chguy/fix/14402

Fix RoomAvatar viewAvatarOnClick to work on actual avatars instead of default ones
This commit is contained in:
Michael Telatynski
2020-07-13 15:28:29 +01:00
committed by GitHub

View File

@@ -126,16 +126,16 @@ export default class RoomAvatar extends React.Component<IProps, IState> {
};
public render() {
/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
const {room, oobData, viewAvatarOnClick, ...otherProps} = this.props;
const roomName = room ? room.name : oobData.name;
return (
<BaseAvatar {...otherProps} name={roomName}
<BaseAvatar {...otherProps}
name={roomName}
idName={room ? room.roomId : null}
urls={this.state.urls}
onClick={this.props.viewAvatarOnClick && !this.state.urls[0] ? this.onRoomAvatarClick : null}
onClick={viewAvatarOnClick && this.state.urls[0] ? this.onRoomAvatarClick : null}
/>
);
}