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)
12 lines
462 B
TypeScript
12 lines
462 B
TypeScript
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);
|
|
const isLoggedIn = useIsLogged();
|
|
return isLoggedIn ? currentUser?.onboardingStatus : undefined;
|
|
};
|