diff --git a/src/courseware/course/new-sidebar/Sidebar.jsx b/src/courseware/course/new-sidebar/Sidebar.jsx index cd8d3fd522..e8debc661c 100644 --- a/src/courseware/course/new-sidebar/Sidebar.jsx +++ b/src/courseware/course/new-sidebar/Sidebar.jsx @@ -4,9 +4,9 @@ import SidebarContext from './SidebarContext'; import { SIDEBARS } from './sidebars'; const Sidebar = () => { - const { currentSidebar } = useContext(SidebarContext); + const { currentSidebar, isDiscussionbarAvailable, isNotificationbarAvailable } = useContext(SidebarContext); - if (currentSidebar === null) { return null; } + if (currentSidebar === null || (!isDiscussionbarAvailable && !isNotificationbarAvailable)) { return null; } const SidebarToRender = SIDEBARS[currentSidebar].Sidebar; return ( diff --git a/src/courseware/course/new-sidebar/SidebarContextProvider.jsx b/src/courseware/course/new-sidebar/SidebarContextProvider.jsx index 5f38c72edc..679f083cb4 100644 --- a/src/courseware/course/new-sidebar/SidebarContextProvider.jsx +++ b/src/courseware/course/new-sidebar/SidebarContextProvider.jsx @@ -32,7 +32,7 @@ const SidebarProvider = ({ ); const topic = useModel('discussionTopics', unitId); const { verifiedMode } = useModel('courseHomeMeta', courseId); - const isDiscussionbarAvailable = topic?.id && topic?.enabledInContext; + const isDiscussionbarAvailable = (topic?.id && topic?.enabledInContext) || false; const isNotificationbarAvailable = !isEmpty(verifiedMode); const onNotificationSeen = useCallback(() => {