MOBILE-3320 sync: Fix cannot read 'updated' of undefined

main
Dani Palou 2021-06-04 15:33:24 +02:00
parent 7cc8fa0b9e
commit c15d5de95d
4 changed files with 9 additions and 9 deletions

View File

@ -407,8 +407,8 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo
*
* @return Promise resolved when done.
*/
protected async sync(): Promise<void> {
await AddonModAssignSync.syncAssign(this.assign!.id);
protected sync(): Promise<AddonModAssignSyncResult> {
return AddonModAssignSync.syncAssign(this.assign!.id);
}
/**

View File

@ -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<AddonModAssignSavePluginData> {
protected async prepareSubmissionData(inputData: CoreFormFields): Promise<AddonModAssignSavePluginData> {
// 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,

View File

@ -514,8 +514,8 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
*
* @return Promise resolved when done.
*/
protected async sync(): Promise<void> {
await AddonModDataPrefetchHandler.sync(this.module, this.courseId);
protected sync(): Promise<AddonModDataSyncResult> {
return AddonModDataPrefetchHandler.sync(this.module, this.courseId);
}
/**

View File

@ -233,8 +233,8 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo
*
* @return Promise resolved when done.
*/
protected async sync(): Promise<void> {
await AddonModSurveySync.syncSurvey(this.survey!.id, this.currentUserId);
protected sync(): Promise<AddonModSurveySyncResult> {
return AddonModSurveySync.syncSurvey(this.survey!.id, this.currentUserId);
}
/**