From ea794345f4ae35aadc2e89ef7a5c5e27680912fb Mon Sep 17 00:00:00 2001 From: toanlam Date: Thu, 6 Apr 2023 11:20:29 +0700 Subject: [PATCH 1/2] MOBILE-4300 course-storage: Update section size when delete all --- .../pages/course-storage/course-storage.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/addons/storagemanager/pages/course-storage/course-storage.ts b/src/addons/storagemanager/pages/course-storage/course-storage.ts index 7ad1d6f52..920777f5f 100644 --- a/src/addons/storagemanager/pages/course-storage/course-storage.ts +++ b/src/addons/storagemanager/pages/course-storage/course-storage.ts @@ -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(); } } From 53c66b3542c200e664a8b95575821fa9023e2072 Mon Sep 17 00:00:00 2001 From: toanlamt <67050522+toanlamt@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:20:27 +0700 Subject: [PATCH 2/2] Update src/addons/storagemanager/pages/course-storage/course-storage.ts Co-authored-by: Noel De Martin --- .../storagemanager/pages/course-storage/course-storage.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/addons/storagemanager/pages/course-storage/course-storage.ts b/src/addons/storagemanager/pages/course-storage/course-storage.ts index 920777f5f..445e02dfe 100644 --- a/src/addons/storagemanager/pages/course-storage/course-storage.ts +++ b/src/addons/storagemanager/pages/course-storage/course-storage.ts @@ -494,12 +494,8 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy { 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; - }); + if (this.totalSize === 0) { + this.sections.map(section => section.totalSize = 0); } this.changeDetectorRef.markForCheck(); }