diff --git a/src/addons/mod/assign/components/index/index.ts b/src/addons/mod/assign/components/index/index.ts index 83b84b236..edf0e7144 100644 --- a/src/addons/mod/assign/components/index/index.ts +++ b/src/addons/mod/assign/components/index/index.ts @@ -407,8 +407,8 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo * * @return Promise resolved when done. */ - protected async sync(): Promise { - await AddonModAssignSync.syncAssign(this.assign!.id); + protected sync(): Promise { + return AddonModAssignSync.syncAssign(this.assign!.id); } /** diff --git a/src/addons/mod/assign/pages/edit/edit.ts b/src/addons/mod/assign/pages/edit/edit.ts index 43dd2a858..98884b13e 100644 --- a/src/addons/mod/assign/pages/edit/edit.ts +++ b/src/addons/mod/assign/pages/edit/edit.ts @@ -235,12 +235,12 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { * @param inputData The input data. * @return Promise resolved with the data to submit. */ - protected prepareSubmissionData(inputData: CoreFormFields): Promise { + protected async prepareSubmissionData(inputData: CoreFormFields): Promise { // If there's offline data, always save it in offline. this.saveOffline = this.hasOffline; try { - return AddonModAssignHelper.prepareSubmissionPluginData( + return await AddonModAssignHelper.prepareSubmissionPluginData( this.assign!, this.userSubmission, inputData, @@ -251,7 +251,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave { // Cannot submit in online, prepare for offline usage. this.saveOffline = true; - return AddonModAssignHelper.prepareSubmissionPluginData( + return await AddonModAssignHelper.prepareSubmissionPluginData( this.assign!, this.userSubmission, inputData, diff --git a/src/addons/mod/data/components/index/index.ts b/src/addons/mod/data/components/index/index.ts index 4f27405a5..c99612586 100644 --- a/src/addons/mod/data/components/index/index.ts +++ b/src/addons/mod/data/components/index/index.ts @@ -514,8 +514,8 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp * * @return Promise resolved when done. */ - protected async sync(): Promise { - await AddonModDataPrefetchHandler.sync(this.module, this.courseId); + protected sync(): Promise { + return AddonModDataPrefetchHandler.sync(this.module, this.courseId); } /** diff --git a/src/addons/mod/survey/components/index/index.ts b/src/addons/mod/survey/components/index/index.ts index 38db91dd8..8979f9e03 100644 --- a/src/addons/mod/survey/components/index/index.ts +++ b/src/addons/mod/survey/components/index/index.ts @@ -233,8 +233,8 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo * * @return Promise resolved when done. */ - protected async sync(): Promise { - await AddonModSurveySync.syncSurvey(this.survey!.id, this.currentUserId); + protected sync(): Promise { + return AddonModSurveySync.syncSurvey(this.survey!.id, this.currentUserId); } /**