diff --git a/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html index e4e86a524..a394f589b 100644 --- a/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addon/mod/lesson/components/index/addon-mod-lesson-index.html @@ -13,7 +13,7 @@ - + diff --git a/src/addon/mod/lesson/providers/report-link-handler.ts b/src/addon/mod/lesson/providers/report-link-handler.ts index e07c9978c..76d8703ac 100644 --- a/src/addon/mod/lesson/providers/report-link-handler.ts +++ b/src/addon/mod/lesson/providers/report-link-handler.ts @@ -105,7 +105,7 @@ export class AddonModLessonReportLinkHandler extends CoreContentLinksHandlerBase module: module, courseId: Number(courseId), action: 'report', - group: groupId + group: isNaN(groupId) ? null : groupId }; this.linkHelper.goInSite(navCtrl, 'AddonModLessonIndexPage', pageParams, siteId); diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 2dc4faf73..d17a5e39e 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -131,9 +131,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe ionViewDidEnter(): void { this.isCurrentView = true; - if (this.initialized) { - this.calculateSlides(); - } + this.calculateSlides(); this.registerBackButtonAction(); } @@ -188,6 +186,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe if (this.getIndex(tab) == -1) { this.tabs.push(tab); this.sortTabs(); + this.calculateSlides(); if (this.initialized && this.tabs.length > 1 && this.tabBarHeight == 0) { @@ -204,7 +203,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe * Calculate slides. */ calculateSlides(): void { - if (!this.isCurrentView || !this.tabsShown) { + if (!this.isCurrentView || !this.tabsShown || !this.initialized) { // Don't calculate if component isn't in current view, the calculations are wrong. return; } @@ -288,10 +287,10 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe } } + this.initialized = true; + // Check which arrows should be shown. this.calculateSlides(); - - this.initialized = true; } /**