MOBILE-3780 assign: Fix getSizeForEdit in file submissions

main
Dani Palou 2022-02-23 14:54:25 +01:00
parent 3a51b361fd
commit be0ce93a0f
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@
import { Injectable } from '@angular/core';
import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader';
import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites';
import { FileEntry } from '@ionic-native/file/ngx';
import { FileEntry, DirectoryEntry } from '@ionic-native/file/ngx';
import {
AddonModAssignProvider,
AddonModAssignAssign,

View File

@ -187,7 +187,8 @@ export class AddonModAssignSubmissionFileHandlerService implements AddonModAssig
plugin: AddonModAssignPlugin,
): Promise<number> {
// Check if there's any change.
if (this.hasDataChanged(assign, submission, plugin)) {
const hasChanged = await this.hasDataChanged(assign, submission, plugin);
if (hasChanged) {
const files = CoreFileSession.getFiles(AddonModAssignProvider.COMPONENT, assign.id);
return CoreFileHelper.getTotalFilesSize(files);