Skip to content

Commit

Permalink
fix: use username if exists, providerId otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Volland committed Jun 20, 2022
1 parent 3478c34 commit 61e8dd5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Component/Menu/User/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const User: React.FC<UserProps> = (props) => {
}
};

const userName = userInfo?.providerDetails?.username || userInfo?.authProviderId;

return (
<Dropdown
className="user-menu"
Expand All @@ -60,12 +62,12 @@ export const User: React.FC<UserProps> = (props) => {
className="user-chip-menu"
>
{
userInfo?.authProviderId &&
userName &&
<div
className="user-name"
>
<span>
{userInfo.authProviderId}
{userName}
</span>
</div>
}
Expand Down Expand Up @@ -109,7 +111,7 @@ export const User: React.FC<UserProps> = (props) => {
<span
className="username"
>
{userInfo?.authProviderId}
{userName}
</span>
</div>
</Dropdown>
Expand Down

0 comments on commit 61e8dd5

Please sign in to comment.