1- import { getConfig } from '@edx/frontend-platform' ;
21import {
32 createContext ,
43 useContext ,
@@ -10,7 +9,7 @@ import { useNavigate } from 'react-router';
109import { useToggleWithValue } from '@src/hooks' ;
1110import { type UnitXBlock , type XBlock } from '@src/data/types' ;
1211import { CourseDetailsData } from './data/api' ;
13- import { useCourseDetails , useWaffleFlags } from './data/apiHooks' ;
12+ import { useCourseDetails } from './data/apiHooks' ;
1413import { RequestStatusType } from './data/constants' ;
1514import { getOutlineIndexData } from './course-outline/data/selectors' ;
1615
@@ -53,7 +52,6 @@ export const CourseAuthoringProvider = ({
5352 courseId,
5453} : CourseAuthoringProviderProps ) => {
5554 const navigate = useNavigate ( ) ;
56- const waffleFlags = useWaffleFlags ( ) ;
5755 const { data : courseDetails , status : courseDetailStatus } = useCourseDetails ( courseId ) ;
5856 const canChangeProviders = getAuthenticatedUser ( ) . administrator || new Date ( courseDetails ?. start ?? 0 ) > new Date ( ) ;
5957 const { courseStructure } = useSelector ( getOutlineIndexData ) ;
@@ -65,26 +63,12 @@ export const CourseAuthoringProvider = ({
6563 closeUnlinkModal ,
6664 ] = useToggleWithValue < ModalState > ( ) ;
6765
68- const getUnitUrl = ( locator : string ) => {
69- if ( getConfig ( ) . ENABLE_UNIT_PAGE === 'true' && waffleFlags . useNewUnitPage ) {
70- // instanbul ignore next
71- return `/course/${ courseId } /container/${ locator } ` ;
72- }
73- return `${ getConfig ( ) . STUDIO_BASE_URL } /container/${ locator } ` ;
74- } ;
66+ const getUnitUrl = ( locator : string ) => `/course/${ courseId } /container/${ locator } ` ;
7567
7668 /**
7769 * Open the unit page for a given locator.
7870 */
79- const openUnitPage = async ( locator : string ) => {
80- const url = getUnitUrl ( locator ) ;
81- if ( getConfig ( ) . ENABLE_UNIT_PAGE === 'true' && waffleFlags . useNewUnitPage ) {
82- // instanbul ignore next
83- navigate ( url ) ;
84- } else {
85- window . location . assign ( url ) ;
86- }
87- } ;
71+ const openUnitPage = async ( locator : string ) => { navigate ( getUnitUrl ( locator ) ) ; } ;
8872
8973 const context = useMemo < CourseAuthoringContextData > ( ( ) => ( {
9074 courseId,
0 commit comments