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 { .addon-mod_wiki-page-content {
background-color: $white; background-color: $white;
border-top: 1px solid $gray; border-top: 1px solid $gray;
@include safe-area-padding-horizontal(0px, 0px); @include safe-area-padding-horizontal(10px, 10px);
@include darkmode() { @include darkmode() {
background-color: $black; background-color: $black;
} }

View File

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