Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Fixes no lesson error for quizzes #178

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Upcoming release]
- Added "Anu LMS Demo content" module.
- Added path alias patterns for Anu LMS content types.
- Fixed no lesson error for quizzes.

## [2.5.0-alpha]
- Move progress tracking to frontend and make progress available offline.
Expand Down
6 changes: 3 additions & 3 deletions js/src/pages/lesson/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ const LessonPage = ({ lesson, quiz, course, width }) => {
// TODO: get URL of the current lesson.
const fallbackUrl = '/';
useEffect(() => {
if (lesson.isRestricted) {
if (content.isRestricted) {
window.location.href = fallbackUrl;
}
}, [lesson.isRestricted, fallbackUrl]);
}, [content.isRestricted, fallbackUrl]);

if (lesson.isRestricted) {
if (content.isRestricted) {
return <LoadingIndicator isLoading={true} />;
}

Expand Down