Skip to content

Commit

Permalink
fix: only prefetch MyCareer tab/data when feature is enabled (#1088)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz authored May 23, 2024
1 parent df5ed42 commit cd810e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/dashboard/data/useDashboardTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ const useDashboardTabs = () => {

// Creates prefetch logic based on loadable-components, "component splitting" capability expose to Tabs component
const prefetchTabs = useCallback(() => {
// Preload/prefetch "My Career" tab.
MyCareerTab.preload();
if (learnerCurrentJobID) {
queryClient.prefetchQuery(queryLearnerSkillLevels(learnerCurrentJobID));
if (features.FEATURE_ENABLE_MY_CAREER) {
// Preload/prefetch "My Career" tab.
MyCareerTab.preload();
if (learnerCurrentJobID) {
queryClient.prefetchQuery(queryLearnerSkillLevels(learnerCurrentJobID));
}
}
}, [learnerCurrentJobID, queryClient]);

Expand Down

0 comments on commit cd810e3

Please sign in to comment.