diff --git a/src/core/course/providers/course.ts b/src/core/course/providers/course.ts index c40e5c7ba..7e6d02696 100644 --- a/src/core/course/providers/course.ts +++ b/src/core/course/providers/course.ts @@ -985,6 +985,7 @@ export class CoreCourseProvider { await this.sitePluginsProvider.waitFetchPlugins(); if (typeof course.format == 'undefined') { + // This block can be replaced by a call to CourseHelper.getCourse(), but it is circular dependant. const coursesProvider = CoreCourses.instance; try { course = await coursesProvider.getUserCourse(course.id, true); diff --git a/src/core/courses/pages/course-preview/course-preview.ts b/src/core/courses/pages/course-preview/course-preview.ts index 664960ed4..fd9131a0f 100644 --- a/src/core/courses/pages/course-preview/course-preview.ts +++ b/src/core/courses/pages/course-preview/course-preview.ts @@ -24,7 +24,6 @@ import { CoreCoursesProvider } from '../../providers/courses'; import { CoreCourseOptionsDelegate } from '@core/course/providers/options-delegate'; import { CoreCourseProvider } from '@core/course/providers/course'; import { CoreCourseHelperProvider } from '@core/course/providers/helper'; -import { CoreCourseFormatDelegate } from '@core/course/providers/format-delegate'; /** * Page that allows "previewing" a course and enrolling in it if enabled and not enrolled. @@ -64,13 +63,23 @@ export class CoreCoursesCoursePreviewPage implements OnDestroy { protected currentInstanceId: number; protected courseStatusObserver; - constructor(private navCtrl: NavController, navParams: NavParams, private sitesProvider: CoreSitesProvider, - private domUtils: CoreDomUtilsProvider, private textUtils: CoreTextUtilsProvider, appProvider: CoreAppProvider, - private coursesProvider: CoreCoursesProvider, private platform: Platform, private modalCtrl: ModalController, - private translate: TranslateService, private eventsProvider: CoreEventsProvider, - private courseOptionsDelegate: CoreCourseOptionsDelegate, private courseHelper: CoreCourseHelperProvider, - private courseProvider: CoreCourseProvider, private courseFormatDelegate: CoreCourseFormatDelegate, - private zone: NgZone) { + constructor( + protected navCtrl: NavController, + navParams: NavParams, + protected sitesProvider: CoreSitesProvider, + protected domUtils: CoreDomUtilsProvider, + protected textUtils: CoreTextUtilsProvider, + appProvider: CoreAppProvider, + protected coursesProvider: CoreCoursesProvider, + protected platform: Platform, + protected modalCtrl: ModalController, + protected translate: TranslateService, + protected eventsProvider: CoreEventsProvider, + protected courseOptionsDelegate: CoreCourseOptionsDelegate, + protected courseHelper: CoreCourseHelperProvider, + protected courseProvider: CoreCourseProvider, + protected zone: NgZone + ) { this.course = navParams.get('course'); this.avoidOpenCourse = navParams.get('avoidOpenCourse');