Fix error messages on sign up (#10399)

In this PR:
- adding logs to track workspace creation performance
- refactor useIsWorkspaceSuspended to be more generic
- only fetch favorites and views if workspace is Active to avoid error
messages on sign up (workspace is not created yet)
This commit is contained in:
Charles Bochet
2025-02-21 18:34:40 +01:00
committed by GitHub
parent 1ed9de2300
commit 2039986684
12 changed files with 138 additions and 38 deletions

View File

@ -1,9 +1,11 @@
import { useRecoilValue } from 'recoil';
import { useIsLogged } from '@/auth/hooks/useIsLogged';
import { currentUserState } from '@/auth/states/currentUserState';
import { OnboardingStatus } from '~/generated/graphql';
export const useOnboardingStatus = (): OnboardingStatus | null | undefined => {
const currentUser = useRecoilValue(currentUserState);
return currentUser?.onboardingStatus;
const isLoggedIn = useIsLogged();
return isLoggedIn ? currentUser?.onboardingStatus : undefined;
};