From dc2b3049a8e83f317392c40ce8401dd660f72312 Mon Sep 17 00:00:00 2001 From: connorhaugh Date: Thu, 11 Jan 2024 14:19:30 +0000 Subject: [PATCH] fix: dont allow course detail page to break editor --- src/CourseAuthoringPage.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CourseAuthoringPage.jsx b/src/CourseAuthoringPage.jsx index 3e6b50f2e3..c442f94065 100644 --- a/src/CourseAuthoringPage.jsx +++ b/src/CourseAuthoringPage.jsx @@ -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 ( ); @@ -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 && - : (showHeader && ( + {inProgress ? !isEditor && + : (!isEditor && ( { ) )} {children} - {!inProgress && showHeader && } + {!inProgress && !isEditor && } ); };