diff --git a/src/addon/mod/wiki/components/index/index.scss b/src/addon/mod/wiki/components/index/index.scss index e7edc2e28..4e4fcb283 100644 --- a/src/addon/mod/wiki/components/index/index.scss +++ b/src/addon/mod/wiki/components/index/index.scss @@ -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; } diff --git a/src/addon/mod/wiki/components/index/index.ts b/src/addon/mod/wiki/components/index/index.ts index 5bb22176e..f72447642 100644 --- a/src/addon/mod/wiki/components/index/index.ts +++ b/src/addon/mod/wiki/components/index/index.ts @@ -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.