commit
b55ca46c4c
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<!-- Content. -->
|
||||
<core-loading [hideUntil]="loaded" class="core-loading-center">
|
||||
|
||||
<core-tabs [selectedIndex]="selectedTab">
|
||||
<core-tabs [hideUntil]="loaded" [selectedIndex]="selectedTab">
|
||||
<!-- Index/Preview tab. -->
|
||||
<core-tab [title]="'addon.mod_lesson.preview' | translate">
|
||||
<ng-template>
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -144,9 +144,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
|||
ionViewDidEnter(): void {
|
||||
this.isCurrentView = true;
|
||||
|
||||
if (this.initialized) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -261,7 +261,7 @@ export class CoreWSProvider {
|
|||
data = data[0];
|
||||
|
||||
if (data.error) {
|
||||
return rejectWithError(data);
|
||||
return rejectWithError(data.exception);
|
||||
}
|
||||
|
||||
return data.data;
|
||||
|
|
Loading…
Reference in New Issue