Skip to content

Commit

Permalink
fix: error when navigating exam units
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharis278 committed Aug 8, 2023
1 parent 03543c0 commit 12233cd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/courseware/course/sequence/Unit/hooks/useExamAccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ const useExamAccess = ({
const [blockAccess, setBlockAccess] = useKeyedState(stateKeys.blockAccess, isExam());
React.useEffect(() => {
if (isExam()) {
return fetchExamAccess()
fetchExamAccess()
.catch((error) => {
logError(error);
})
.finally(() => {
const examAccess = getExamAccess();
setAccessToken(examAccess);
setBlockAccess(false);
})
.catch((error) => {
logError(error);
});
}
return undefined;
}, [id]);

return {
Expand Down

0 comments on commit 12233cd

Please sign in to comment.