fix(tutorial): skip getting steps if there is no user (#6786)

This commit is contained in:
Aditya Radhakrishnan 2022-12-16 11:18:43 -08:00 committed by GitHub
parent 9716a49067
commit d48e44499e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ import { CURRENT_ONBOARDING_IDS } from '../app/onboarding/OnboardingConfig';
export function EducationStepsProvider({ children }: { children: React.ReactNode }) {
const userUrn = useGetAuthenticatedUser()?.corpUser.urn;
const stepIds = getStepIds(userUrn || '');
const { data } = useBatchGetStepStatesQuery({ variables: { input: { ids: stepIds } } });
const { data } = useBatchGetStepStatesQuery({ skip: !userUrn, variables: { input: { ids: stepIds } } });
const results = data?.batchGetStepStates.results;
const [educationSteps, setEducationSteps] = useState<StepStateResult[] | null>(results || null);
const [educationStepIdsAllowlist, setEducationStepIdsAllowlist] = useState<Set<string>>(