Skip to content

Commit

Permalink
fix(tutorial): skip getting steps if there is no user (#6786)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-radhakrishnan authored Dec 16, 2022
1 parent 9716a49 commit d48e444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datahub-web-react/src/providers/EducationStepsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>>(
Expand Down

0 comments on commit d48e444

Please sign in to comment.