MOBILE-4300 course-storage: Update section size when delete all

main
toanlam 2023-04-06 11:20:29 +07:00
parent b6a2e5fccf
commit ea794345f4
1 changed files with 9 additions and 0 deletions

View File

@ -492,6 +492,15 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
await this.updateModulesSizes(modules, section);
CoreCourseHelper.calculateSectionsStatus(this.sections, this.courseId, false, false);
// For delete all, reset all section sizes so icons are updated.
if (this.totalSize == 0) {
this.sections.map((section) => {
section.calculatingSize = true;
section.totalSize = 0;
section.calculatingSize = false;
});
}
this.changeDetectorRef.markForCheck();
}
}