diff --git a/src/addon/messages/pages/contacts/contacts.ts b/src/addon/messages/pages/contacts/contacts.ts index d27dc3662..047961507 100644 --- a/src/addon/messages/pages/contacts/contacts.ts +++ b/src/addon/messages/pages/contacts/contacts.ts @@ -73,6 +73,11 @@ export class AddonMessagesContactsPage implements OnDestroy { * User entered the page. */ ionViewDidEnter(): void { + if (!this.splitviewCtrl.isOn()) { + this.selectedUserId.contacts = null; + this.selectedUserId.requests = null; + } + this.tabsComponent && this.tabsComponent.ionViewDidEnter(); } 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/components/index/index.ts b/src/addon/mod/lesson/components/index/index.ts index 015434ce0..ada4eded7 100644 --- a/src/addon/mod/lesson/components/index/index.ts +++ b/src/addon/mod/lesson/components/index/index.ts @@ -535,6 +535,8 @@ export class AddonModLessonIndexComponent extends CoreCourseModuleMainActivityCo const preventReason = this.lessonProvider.getPreventAccessReason(this.accessInfo, true); if (preventReason) { this.preventMessages = [preventReason]; + } else { + this.preventMessages = []; } // Log view now that we have the password. diff --git a/src/addon/mod/lesson/providers/lesson.ts b/src/addon/mod/lesson/providers/lesson.ts index dd15ed778..6af1f19d1 100644 --- a/src/addon/mod/lesson/providers/lesson.ts +++ b/src/addon/mod/lesson/providers/lesson.ts @@ -314,10 +314,10 @@ export class AddonModLessonProvider { * @param {boolean} [review] If the user wants to review just after finishing (1 hour margin). * @param {any} [pageIndex] Object containing all the pages indexed by ID. If not defined, it will be calculated. * @param {string} [siteId] Site ID. If not defined, current site. - * @return {Promise<{reviewMode: boolean, progress: number, ongoingScore: string}>} Promise resolved with the data. + * @return {Promise<{reviewmode: boolean, progress: number, ongoingscore: string}>} Promise resolved with the data. */ protected calculateOfflineData(lesson: any, accessInfo?: any, password?: string, review?: boolean, pageIndex?: any, - siteId?: string): Promise<{reviewMode: boolean, progress: number, ongoingScore: string}> { + siteId?: string): Promise<{reviewmode: boolean, progress: number, ongoingscore: string}> { accessInfo = accessInfo || {}; @@ -342,9 +342,9 @@ export class AddonModLessonProvider { return Promise.all(promises).then(() => { return { - reviewMode: reviewMode, + reviewmode: reviewMode, progress: progress, - ongoingScore: ongoingMessage + ongoingscore: ongoingMessage }; }); } 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 d46d12170..1e38c3cd8 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -144,9 +144,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe ionViewDidEnter(): void { this.isCurrentView = true; - if (this.initialized) { - this.calculateSlides(); - } + this.calculateSlides(); this.registerBackButtonAction(); } @@ -201,6 +199,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) { @@ -217,7 +216,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; } @@ -301,10 +300,10 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe } } + this.initialized = true; + // Check which arrows should be shown. this.calculateSlides(); - - this.initialized = true; } /** diff --git a/src/providers/ws.ts b/src/providers/ws.ts index 7372bbfff..de16e3103 100644 --- a/src/providers/ws.ts +++ b/src/providers/ws.ts @@ -261,7 +261,7 @@ export class CoreWSProvider { data = data[0]; if (data.error) { - return rejectWithError(data); + return rejectWithError(data.exception); } return data.data;