diff --git a/src/pages/academy/Academy.tsx b/src/pages/academy/Academy.tsx index 4a9e92a226..42a3b9e7bc 100644 --- a/src/pages/academy/Academy.tsx +++ b/src/pages/academy/Academy.tsx @@ -9,7 +9,6 @@ import Constants from 'src/commons/utils/Constants'; import { useTypedSelector } from 'src/commons/utils/Hooks'; import { - fetchGradingOverviews, fetchNotifications, updateLatestViewedCourse } from '../../commons/application/actions/SessionActions'; @@ -33,7 +32,6 @@ const Academy: React.FC<{}> = () => { const dispatch = useDispatch(); React.useEffect(() => { dispatch(fetchNotifications()); - dispatch(fetchGradingOverviews(false)); }, [dispatch]); const agreedToResearch = useTypedSelector(state => state.session.agreedToResearch); diff --git a/src/pages/academy/grading/Grading.tsx b/src/pages/academy/grading/Grading.tsx index dd9a9c6227..abcea014be 100644 --- a/src/pages/academy/grading/Grading.tsx +++ b/src/pages/academy/grading/Grading.tsx @@ -1,6 +1,8 @@ import { NonIdealState, Spinner, SpinnerSize } from '@blueprintjs/core'; import * as React from 'react'; +import { useDispatch } from 'react-redux'; import { Navigate, useParams } from 'react-router'; +import { fetchGradingOverviews } from 'src/commons/application/actions/SessionActions'; import { useTypedSelector } from 'src/commons/utils/Hooks'; import { numberRegExp } from 'src/features/academy/AcademyTypes'; @@ -16,6 +18,11 @@ const Grading: React.FC = () => { questionId: string; }>(); + const dispatch = useDispatch(); + React.useEffect(() => { + dispatch(fetchGradingOverviews(false)); + }, [dispatch]); + // If submissionId or questionId is defined but not numeric, redirect back to the Grading overviews page if ( (params.submissionId && !params.submissionId?.match(numberRegExp)) ||