File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 77 ChevronLeft as ChevronLeftIcon ,
88} from '@openedx/paragon/icons' ;
99
10- import { useModel } from '@src/generic/model-store' ;
1110import { LOADING } from '@src/constants' ;
1211import PageLoading from '@src/generic/PageLoading' ;
1312import SidebarSection from './components/SidebarSection' ;
@@ -35,13 +34,13 @@ const CourseOutlineTray = () => {
3534 sequences,
3635 } = useCourseOutlineSidebar ( ) ;
3736
38- const {
39- sectionId : activeSectionId ,
40- } = useModel ( 'sequences' , activeSequenceId ) ;
41-
37+ const resolvedSectionId = selectedSection
38+ || Object . keys ( sections ) . find (
39+ ( sectionId ) => sections [ sectionId ] . sequenceIds . includes ( activeSequenceId ) ,
40+ ) ;
4241 const sectionsIds = Object . keys ( sections ) ;
43- const sequenceIds = sections [ selectedSection || activeSectionId ] ?. sequenceIds || [ ] ;
44- const backButtonTitle = sections [ selectedSection || activeSectionId ] ?. title ;
42+ const sequenceIds = sections [ resolvedSectionId ] ?. sequenceIds || [ ] ;
43+ const backButtonTitle = sections [ resolvedSectionId ] ?. title ;
4544
4645 const handleBackToSectionLevel = ( ) => {
4746 setDisplaySectionLevel ( ) ;
You can’t perform that action at this time.
0 commit comments