Skip to content

fix: Issue-1403. Course sidebar not showing sections on pending courses #1679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();
Expand Down