Skip to content

Commit a3bb081

Browse files
crazyserverdpalou
authored andcommitted
MOBILE-4660 storagemanager: Avoid scroll when all sections is selected
1 parent a2c6a5b commit a3bb081

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/addons/storagemanager/pages/course-storage/course-storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
142142

143143
this.loaded = true;
144144

145-
if (initialSectionId !== undefined) {
145+
if (initialSectionId !== undefined && initialSectionId > 0) {
146146
this.accordionMultipleValue.push(initialSectionId.toString());
147147

148148
CoreDom.scrollToElement(

src/core/features/course/components/course-format/course-format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,14 +529,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
529529
* Open course downloads page.
530530
*/
531531
async gotoCourseDownloads(): Promise<void> {
532-
const selectedId = await this.getSelectedSectionId();
532+
const sectionId = this.selectedSection?.id !== this.allSectionsId ? this.selectedSection?.id : undefined;
533533

534534
CoreNavigator.navigateToSitePath(
535535
`storage/${this.course.id}`,
536536
{
537537
params: {
538538
title: this.course.fullname,
539-
sectionId: selectedId,
539+
sectionId,
540540
isGuest: this.isGuest,
541541
},
542542
},

0 commit comments

Comments
 (0)