diff --git a/src/addons/storagemanager/pages/course-storage/course-storage.ts b/src/addons/storagemanager/pages/course-storage/course-storage.ts index 40f2895a5..e9adc9f31 100644 --- a/src/addons/storagemanager/pages/course-storage/course-storage.ts +++ b/src/addons/storagemanager/pages/course-storage/course-storage.ts @@ -142,7 +142,7 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy { this.loaded = true; - if (initialSectionId !== undefined) { + if (initialSectionId !== undefined && initialSectionId > 0) { this.accordionMultipleValue.push(initialSectionId.toString()); CoreDom.scrollToElement( diff --git a/src/core/features/course/components/course-format/course-format.ts b/src/core/features/course/components/course-format/course-format.ts index a52f5c3eb..5db3f29dd 100644 --- a/src/core/features/course/components/course-format/course-format.ts +++ b/src/core/features/course/components/course-format/course-format.ts @@ -529,14 +529,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { * Open course downloads page. */ async gotoCourseDownloads(): Promise { - const selectedId = await this.getSelectedSectionId(); + const sectionId = this.selectedSection?.id !== this.allSectionsId ? this.selectedSection?.id : undefined; CoreNavigator.navigateToSitePath( `storage/${this.course.id}`, { params: { title: this.course.fullname, - sectionId: selectedId, + sectionId, isGuest: this.isGuest, }, },