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

Commit 25c9b26

Browse files
authored
Merge pull request #5348 from matrix-org/t3chguy/fix/15511
Fix User Menu avatar colouring being based on wrong string
2 parents fa1a956 + 0170fa6 commit 25c9b26

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/structures/UserMenu.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ export default class UserMenu extends React.Component<IProps, IState> {
452452
public render() {
453453
const avatarSize = 32; // should match border-radius of the avatar
454454

455-
const displayName = OwnProfileStore.instance.displayName || MatrixClientPeg.get().getUserId();
455+
const userId = MatrixClientPeg.get().getUserId();
456+
const displayName = OwnProfileStore.instance.displayName || userId;
456457
const avatarUrl = OwnProfileStore.instance.getHttpAvatarUrl(avatarSize);
457458

458459
const prototypeCommunityName = CommunityPrototypeStore.instance.getSelectedCommunityName();
@@ -507,7 +508,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
507508
<div className="mx_UserMenu_row">
508509
<span className="mx_UserMenu_userAvatarContainer">
509510
<BaseAvatar
510-
idName={displayName}
511+
idName={userId}
511512
name={displayName}
512513
url={avatarUrl}
513514
width={avatarSize}

0 commit comments

Comments
 (0)