Merge pull request #2796 from NoelDeMartin/MOBILE-3567
MOBILE-3567 course: Open course after enrollmentmain
commit
e8f3976510
|
@ -331,7 +331,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy {
|
|||
// Sometimes the list of enrolled courses takes a while to be updated. Wait for it.
|
||||
await this.waitForEnrolled(true);
|
||||
|
||||
this.refreshData().finally(() => {
|
||||
await this.refreshData().finally(() => {
|
||||
// My courses have been updated, trigger event.
|
||||
CoreEvents.trigger(CoreCoursesProvider.EVENT_MY_COURSES_UPDATED, {
|
||||
courseId: this.course!.id,
|
||||
|
@ -340,6 +340,8 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy {
|
|||
}, CoreSites.getCurrentSiteId());
|
||||
});
|
||||
|
||||
this.openCourse();
|
||||
|
||||
modal?.dismiss();
|
||||
} catch (error) {
|
||||
modal?.dismiss();
|
||||
|
@ -422,7 +424,7 @@ export class CoreCoursePreviewPage implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
try {
|
||||
CoreCourses.getUserCourse(this.course!.id);
|
||||
await CoreCourses.getUserCourse(this.course!.id);
|
||||
} catch {
|
||||
// Not enrolled, wait a bit and try again.
|
||||
if (this.pageDestroyed || (Date.now() - this.waitStart > 60000)) {
|
||||
|
|
Loading…
Reference in New Issue