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. * @return Promise resolved when done.
*/ */
protected async sync(): Promise<void> { protected sync(): Promise<AddonModAssignSyncResult> {
await AddonModAssignSync.syncAssign(this.assign!.id); return AddonModAssignSync.syncAssign(this.assign!.id);
} }
/** /**

View File

@ -235,12 +235,12 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
* @param inputData The input data. * @param inputData The input data.
* @return Promise resolved with the data to submit. * @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. // If there's offline data, always save it in offline.
this.saveOffline = this.hasOffline; this.saveOffline = this.hasOffline;
try { try {
return AddonModAssignHelper.prepareSubmissionPluginData( return await AddonModAssignHelper.prepareSubmissionPluginData(
this.assign!, this.assign!,
this.userSubmission, this.userSubmission,
inputData, inputData,
@ -251,7 +251,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
// Cannot submit in online, prepare for offline usage. // Cannot submit in online, prepare for offline usage.
this.saveOffline = true; this.saveOffline = true;
return AddonModAssignHelper.prepareSubmissionPluginData( return await AddonModAssignHelper.prepareSubmissionPluginData(
this.assign!, this.assign!,
this.userSubmission, this.userSubmission,
inputData, inputData,

View File

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

View File

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