MOBILE-3320 assign: Fix attachments max files and types

main
Dani Palou 2021-05-27 14:46:52 +02:00
parent 1cd937961f
commit f5e73877a6
1 changed files with 6 additions and 6 deletions

View File

@ -44,12 +44,6 @@ export class AddonModAssignSubmissionFileComponent extends AddonModAssignSubmiss
* Component being initialized. * Component being initialized.
*/ */
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
// Get the offline data.
const filesData = await CoreUtils.ignoreErrors(
AddonModAssignOffline.getSubmission(this.assign.id),
undefined,
);
this.acceptedTypes = this.configs?.filetypeslist; this.acceptedTypes = this.configs?.filetypeslist;
this.maxSize = this.configs?.maxsubmissionsizebytes this.maxSize = this.configs?.maxsubmissionsizebytes
? parseInt(this.configs.maxsubmissionsizebytes, 10) ? parseInt(this.configs.maxsubmissionsizebytes, 10)
@ -58,6 +52,12 @@ export class AddonModAssignSubmissionFileComponent extends AddonModAssignSubmiss
? parseInt(this.configs.maxfilesubmissions, 10) ? parseInt(this.configs.maxfilesubmissions, 10)
: undefined; : undefined;
// Get the offline data.
const filesData = await CoreUtils.ignoreErrors(
AddonModAssignOffline.getSubmission(this.assign.id),
undefined,
);
try { try {
if (filesData && filesData.plugindata && filesData.plugindata.files_filemanager) { if (filesData && filesData.plugindata && filesData.plugindata.files_filemanager) {
const offlineDataFiles = <CoreFileUploaderStoreFilesResult>filesData.plugindata.files_filemanager; const offlineDataFiles = <CoreFileUploaderStoreFilesResult>filesData.plugindata.files_filemanager;