mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-02 21:53:30 +00:00
Fixed issue:- 4530 Users & Teams Page shows loading screen on selecting navigation twice (#4533)
This commit is contained in:
parent
148c96c0a4
commit
ca6f5b6cd6
@ -134,6 +134,7 @@ const TeamsAndUsersPage = () => {
|
||||
break;
|
||||
}
|
||||
}
|
||||
setIsRightPannelLoading(false);
|
||||
setIsUsersLoading(false);
|
||||
};
|
||||
|
||||
@ -224,9 +225,10 @@ const TeamsAndUsersPage = () => {
|
||||
getTeams(['users', 'owns', 'defaultRoles', 'owner'])
|
||||
.then((res: AxiosResponse) => {
|
||||
if (res.data) {
|
||||
if (!teamAndUser && res.data.data > 0) {
|
||||
if (!teamAndUser && res.data.data.length > 0) {
|
||||
getCurrentTeamUsers(res.data.data[0].name);
|
||||
setCurrentTeam(res.data.data[0]);
|
||||
setIsRightPannelLoading(false);
|
||||
}
|
||||
setTeams(res.data.data);
|
||||
AppState.updateUserTeam(res.data.data);
|
||||
@ -243,7 +245,6 @@ const TeamsAndUsersPage = () => {
|
||||
})
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
handleRightPannelLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
@ -281,7 +282,6 @@ const TeamsAndUsersPage = () => {
|
||||
showErrorToast(errMsg);
|
||||
})
|
||||
.finally(() => {
|
||||
setIsLoading(false);
|
||||
setIsRightPannelLoading(false);
|
||||
});
|
||||
}
|
||||
@ -439,14 +439,16 @@ const TeamsAndUsersPage = () => {
|
||||
* @param name - team name
|
||||
*/
|
||||
const changeCurrentTeam = (name: string, isUsersCategory: boolean) => {
|
||||
handleRightPannelLoading(true);
|
||||
history.push(getTeamAndUserDetailsPath(name));
|
||||
if (isUsersCategory) {
|
||||
setIsTeamVisible(false);
|
||||
setCurrentTeam(undefined);
|
||||
} else {
|
||||
setIsTeamVisible(true);
|
||||
setactiveUserTab(undefined);
|
||||
if (name !== teamAndUser) {
|
||||
handleRightPannelLoading(true);
|
||||
history.push(getTeamAndUserDetailsPath(name));
|
||||
if (isUsersCategory) {
|
||||
setIsTeamVisible(false);
|
||||
setCurrentTeam(undefined);
|
||||
} else {
|
||||
setIsTeamVisible(true);
|
||||
setactiveUserTab(undefined);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user