ui: handle tab navigation if no access token (#14952)

* Handle navigation if no access token

* remove dependency
This commit is contained in:
Harsh Vador 2024-01-30 21:00:20 +05:30 committed by GitHub
parent 908edc5eba
commit e2db70c389
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -101,6 +101,19 @@ const Users = ({ userData, queryFilters, updateUserDetails }: Props) => {
setPreviewAsset(asset);
}, []);
const handleTabRedirection = useCallback(() => {
if (!isLoggedInUser && activeTab === UserPageTabs.ACCESS_TOKEN) {
history.push({
pathname: getUserPath(decodedUsername, UserPageTabs.ACTIVITY),
search: location.search,
});
}
}, [activeTab, decodedUsername, isLoggedInUser]);
useEffect(() => {
handleTabRedirection();
}, []);
const handlePersonaUpdate = useCallback(
async (personas: EntityReference[]) => {
await updateUserDetails({ ...userData, personas });