Skip to content

Commit

Permalink
fix: dont allow course detail page to break editor
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhaugh committed Jan 11, 2024
1 parent 0debaec commit dc2b304
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/CourseAuthoringPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const CourseAuthoringPage = ({ courseId, children }) => {
const courseDetailStatus = useSelector(state => state.courseDetail.status);
const inProgress = courseDetailStatus === RequestStatus.IN_PROGRESS;
const { pathname } = useLocation();
const showHeader = !pathname.includes('/editor');
const isEditor = pathname.includes('/editor');

if (courseDetailStatus === RequestStatus.NOT_FOUND) {
if (courseDetailStatus === RequestStatus.NOT_FOUND && !isEditor) {
return (
<NotFoundAlert />
);
Expand All @@ -72,8 +72,8 @@ const CourseAuthoringPage = ({ courseId, children }) => {
using url pattern containing /editor/,
we shouldn't have the header and footer on these pages.
This functionality will be removed in TNL-9591 */}
{inProgress ? showHeader && <Loading />
: (showHeader && (
{inProgress ? !isEditor && <Loading />
: (!isEditor && (
<AppHeader
courseNumber={courseNumber}
courseOrg={courseOrg}
Expand All @@ -83,7 +83,7 @@ const CourseAuthoringPage = ({ courseId, children }) => {
)
)}
{children}
{!inProgress && showHeader && <StudioFooter />}
{!inProgress && !isEditor && <StudioFooter />}
</div>
);
};
Expand Down

0 comments on commit dc2b304

Please sign in to comment.