[WEB-1929] chore: improve finishOnboarding logic to handle case where user profile setup is done and user already has a workspace. (#5105)

This commit is contained in:
Prateek Shourya 2024-07-12 17:17:58 +05:30 committed by GitHub
parent f06095f120
commit ce89c7dcff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 9 deletions

View file

@ -35,7 +35,7 @@ export const AuthenticationWrapper: FC<TAuthenticationWrapper> = observer((props
const { isLoading: isUserLoading, data: currentUser, fetchCurrentUser } = useUser();
const { data: currentUserProfile } = useUserProfile();
const { data: currentUserSettings } = useUserSettings();
const { workspaces } = useWorkspace();
const { loader: workspacesLoader, workspaces } = useWorkspace();
const { isLoading: isUserSWRLoading } = useSWR("USER_INFORMATION", async () => await fetchCurrentUser(), {
revalidateOnFocus: false,
@ -73,7 +73,7 @@ export const AuthenticationWrapper: FC<TAuthenticationWrapper> = observer((props
return redirectionRoute;
};
if ((isUserSWRLoading || isUserLoading) && !currentUser?.id)
if ((isUserSWRLoading || isUserLoading || workspacesLoader) && !currentUser?.id)
return (
<div className="relative flex h-screen w-full items-center justify-center">
<LogoSpinner />