Skip to content

Commit

Permalink
fix: fixed empty section issue (openedx#1292)
Browse files Browse the repository at this point in the history
* fix: fixed empty section issue

* refactor: added checks to hide view
  • Loading branch information
sundasnoreen12 authored Feb 15, 2024
1 parent 9bfa0d0 commit 9dd79ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/courseware/course/new-sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 9dd79ca

Please sign in to comment.