MOBILE-3201 wiki: Fix wiki page log

main
Pau Ferrer Ocaña 2019-12-05 16:54:33 +01:00
parent b4f563282b
commit 0787368872
2 changed files with 8 additions and 6 deletions

View File

@ -13,7 +13,7 @@ ion-app.app-root addon-mod-wiki-index {
.addon-mod_wiki-page-content {
background-color: $white;
border-top: 1px solid $gray;
@include safe-area-padding-horizontal(0px, 0px);
@include safe-area-padding-horizontal(10px, 10px);
@include darkmode() {
background-color: $black;
}

View File

@ -99,14 +99,14 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
return;
}
if (this.isMainPage) {
if (!this.pageId) {
this.wikiProvider.logView(this.wiki.id, this.wiki.name).then(() => {
this.courseProvider.checkModuleCompletion(this.courseId, this.module.completiondata);
}).catch((error) => {
// Ignore errors.
});
} else {
this.wikiProvider.logPageView(this.pageId, this.wiki.id, this.wiki.name).catch(() => {
this.wikiProvider.logPageView(this.pageId, this.wiki.id, this.wiki.name).catch((error) => {
// Ignore errors.
});
}
@ -280,9 +280,11 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
this.currentPage = data.pageId;
this.showLoadingAndFetch(true, false).then(() => {
this.wikiProvider.logPageView(this.currentPage, this.wiki.id, this.wiki.name).catch(() => {
// Ignore errors.
});
if (this.currentPage) {
this.wikiProvider.logPageView(this.currentPage, this.wiki.id, this.wiki.name).catch(() => {
// Ignore errors.
});
}
});
// Stop listening for new page events.