fix: sidebar not showing sections on pending courses (#1679)

This commit is contained in:
wgu-jesse-stewart
2025-05-27 13:47:21 -04:00
committed by GitHub
parent b6c29df0a0
commit d14c2a9ffd

View File

@@ -7,7 +7,6 @@ import {
ChevronLeft as ChevronLeftIcon,
} from '@openedx/paragon/icons';
import { useModel } from '@src/generic/model-store';
import { LOADING } from '@src/constants';
import PageLoading from '@src/generic/PageLoading';
import SidebarSection from './components/SidebarSection';
@@ -35,13 +34,13 @@ const CourseOutlineTray = () => {
sequences,
} = useCourseOutlineSidebar();
const {
sectionId: activeSectionId,
} = useModel('sequences', activeSequenceId);
const resolvedSectionId = selectedSection
|| Object.keys(sections).find(
(sectionId) => sections[sectionId].sequenceIds.includes(activeSequenceId),
);
const sectionsIds = Object.keys(sections);
const sequenceIds = sections[selectedSection || activeSectionId]?.sequenceIds || [];
const backButtonTitle = sections[selectedSection || activeSectionId]?.title;
const sequenceIds = sections[resolvedSectionId]?.sequenceIds || [];
const backButtonTitle = sections[resolvedSectionId]?.title;
const handleBackToSectionLevel = () => {
setDisplaySectionLevel();