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 7
7
ChevronLeft as ChevronLeftIcon ,
8
8
} from '@openedx/paragon/icons' ;
9
9
10
- import { useModel } from '@src/generic/model-store' ;
11
10
import { LOADING } from '@src/constants' ;
12
11
import PageLoading from '@src/generic/PageLoading' ;
13
12
import SidebarSection from './components/SidebarSection' ;
@@ -35,13 +34,13 @@ const CourseOutlineTray = () => {
35
34
sequences,
36
35
} = useCourseOutlineSidebar ( ) ;
37
36
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
+ ) ;
42
41
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 ;
45
44
46
45
const handleBackToSectionLevel = ( ) => {
47
46
setDisplaySectionLevel ( ) ;
You can’t perform that action at this time.
0 commit comments