Fix issue related to teams joining and leaving, name is not getting dispalyed (#4792)

This commit is contained in:
Shailesh Parmar 2022-05-09 13:52:48 +05:30 committed by GitHub
parent b852d2e893
commit 7e2779dbf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -78,6 +78,7 @@ class AppState {
}
updateUserDetails(data: User) {
this.userDetails = data;
this.nonSecureUserDetails = data;
}
updateNewUser(data: NewUser) {
this.newUser = data;

View File

@ -143,7 +143,7 @@ const Appbar: React.FC = (): JSX.Element => {
const getUserName = () => {
const currentUser = isAuthDisabled
? appState.users[0]
? appState.nonSecureUserDetails
: appState.userDetails;
return currentUser?.displayName || currentUser?.name || TERM_USER;
@ -151,7 +151,7 @@ const Appbar: React.FC = (): JSX.Element => {
const getUserData = () => {
const currentUser = isAuthDisabled
? appState.users[0]
? appState.nonSecureUserDetails
: appState.userDetails;
const name = currentUser?.displayName || currentUser?.name || TERM_USER;
@ -199,7 +199,7 @@ const Appbar: React.FC = (): JSX.Element => {
{teams.map((t, i) => (
<p key={i}>
<Link to={getTeamAndUserDetailsPath(t.name as string)}>
{t.displayName}
{t.displayName || t.name}
</Link>
</p>
))}