diff --git a/src/addons/mod/assign/submission/file/component/file.ts b/src/addons/mod/assign/submission/file/component/file.ts index 6e9b73f43..79d8ecfd0 100644 --- a/src/addons/mod/assign/submission/file/component/file.ts +++ b/src/addons/mod/assign/submission/file/component/file.ts @@ -44,12 +44,6 @@ export class AddonModAssignSubmissionFileComponent extends AddonModAssignSubmiss * Component being initialized. */ async ngOnInit(): Promise { - // Get the offline data. - const filesData = await CoreUtils.ignoreErrors( - AddonModAssignOffline.getSubmission(this.assign.id), - undefined, - ); - this.acceptedTypes = this.configs?.filetypeslist; this.maxSize = this.configs?.maxsubmissionsizebytes ? parseInt(this.configs.maxsubmissionsizebytes, 10) @@ -58,6 +52,12 @@ export class AddonModAssignSubmissionFileComponent extends AddonModAssignSubmiss ? parseInt(this.configs.maxfilesubmissions, 10) : undefined; + // Get the offline data. + const filesData = await CoreUtils.ignoreErrors( + AddonModAssignOffline.getSubmission(this.assign.id), + undefined, + ); + try { if (filesData && filesData.plugindata && filesData.plugindata.files_filemanager) { const offlineDataFiles = filesData.plugindata.files_filemanager;