From a3975f47e2986e38bc2098113587109805de9899 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Thu, 11 Jan 2024 09:44:29 -0500 Subject: [PATCH] fix: dont allow course detail page to break editor (#790) At the moment, editors served from V1 libraries are broken because they use the course authoring MFE url (because they use editors in the same way courses do). --- src/CourseAuthoringPage.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CourseAuthoringPage.jsx b/src/CourseAuthoringPage.jsx index 3e6b50f2e..c442f9406 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 && } ); };