@@ -9,24 +9,21 @@ import {
99} from '@openedx/paragon/icons' ;
1010import { useIntl } from '@edx/frontend-platform/i18n' ;
1111
12- import Placeholder from '@src/editors/Placeholder' ;
13- import { RequestStatus } from '@src/data/constants' ;
14- import AlertMessage from '@src/generic/alert-message' ;
15- import InternetConnectionAlert from '@src/generic/internet-connection-alert' ;
16- import { STATEFUL_BUTTON_STATES } from '@src/constants' ;
17- import getPageHeadTitle from '@src/generic/utils' ;
18- import { useScrollToHashElement } from '@src/hooks' ;
12+ import Placeholder from '../editors/Placeholder' ;
13+ import { RequestStatus } from '../data/constants' ;
14+ import { useGetCourseDetails } from './data/apiHooks' ;
15+ import AlertMessage from '../generic/alert-message' ;
16+ import InternetConnectionAlert from '../generic/internet-connection-alert' ;
17+ import { STATEFUL_BUTTON_STATES } from '../constants' ;
18+ import getPageHeadTitle from '../generic/utils' ;
19+ import { useScrollToHashElement } from '../hooks' ;
1920import { useCourseAuthoringContext } from '@src/CourseAuthoringContext' ;
20-
2121import {
2222 fetchCourseSettingsQuery ,
23- fetchCourseDetailsQuery ,
2423 updateCourseDetailsQuery ,
2524} from './data/thunks' ;
2625import {
2726 getCourseSettings ,
28- getCourseDetails ,
29- getLoadingDetailsStatus ,
3027 getLoadingSettingsStatus ,
3128} from './data/selectors' ;
3229import BasicSection from './basic-section' ;
@@ -45,11 +42,10 @@ import { useLoadValuesPrompt, useSaveValuesPrompt } from './hooks';
4542
4643const ScheduleAndDetails = ( ) => {
4744 const intl = useIntl ( ) ;
45+ const courseDetails = useGetCourseDetails ( courseId ) ;
4846 const courseSettings = useSelector ( getCourseSettings ) ;
49- const courseDetails = useSelector ( getCourseDetails ) ;
50- const loadingDetailsStatus = useSelector ( getLoadingDetailsStatus ) ;
5147 const loadingSettingsStatus = useSelector ( getLoadingSettingsStatus ) ;
52- const isLoading = loadingDetailsStatus === RequestStatus . IN_PROGRESS
48+ const isLoading = courseDetails . isLoading
5349 || loadingSettingsStatus === RequestStatus . IN_PROGRESS ;
5450
5551 const { courseId, courseDetails : course } = useCourseAuthoringContext ( ) ;
@@ -81,8 +77,8 @@ const ScheduleAndDetails = () => {
8177 showLoadFailedAlert,
8278 } = useLoadValuesPrompt (
8379 courseId ,
84- fetchCourseDetailsQuery ,
8580 fetchCourseSettingsQuery ,
81+ courseDetails . isError ,
8682 ) ;
8783
8884 const {
@@ -149,7 +145,7 @@ const ScheduleAndDetails = () => {
149145 return < > </ > ;
150146 }
151147
152- if ( loadingDetailsStatus === RequestStatus . DENIED || loadingSettingsStatus === RequestStatus . DENIED ) {
148+ if ( courseDetails . isError || loadingSettingsStatus === RequestStatus . DENIED ) {
153149 return (
154150 < div className = "row justify-content-center m-6" >
155151 < Placeholder />
0 commit comments