File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ import SidebarContext from './SidebarContext';
4
4
import { SIDEBARS } from './sidebars' ;
5
5
6
6
const Sidebar = ( ) => {
7
- const { currentSidebar } = useContext ( SidebarContext ) ;
7
+ const { currentSidebar, isDiscussionbarAvailable , isNotificationbarAvailable } = useContext ( SidebarContext ) ;
8
8
9
- if ( currentSidebar === null ) { return null ; }
9
+ if ( currentSidebar === null || ( ! isDiscussionbarAvailable && ! isNotificationbarAvailable ) ) { return null ; }
10
10
const SidebarToRender = SIDEBARS [ currentSidebar ] . Sidebar ;
11
11
12
12
return (
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const SidebarProvider = ({
32
32
) ;
33
33
const topic = useModel ( 'discussionTopics' , unitId ) ;
34
34
const { verifiedMode } = useModel ( 'courseHomeMeta' , courseId ) ;
35
- const isDiscussionbarAvailable = topic ?. id && topic ?. enabledInContext ;
35
+ const isDiscussionbarAvailable = ( topic ?. id && topic ?. enabledInContext ) || false ;
36
36
const isNotificationbarAvailable = ! isEmpty ( verifiedMode ) ;
37
37
38
38
const onNotificationSeen = useCallback ( ( ) => {
You can’t perform that action at this time.
0 commit comments