From 6379f4e9ac39399a8806b11a7936423acc651f3e Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 23 Aug 2018 10:41:53 +0200 Subject: [PATCH] MOBILE-2559 course: Let teachers view stealth sections --- src/core/course/components/format/format.ts | 4 ++-- src/core/course/pages/section-selector/section-selector.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/course/components/format/format.ts b/src/core/course/components/format/format.ts index c378fe847..b6ec4c1de 100644 --- a/src/core/course/components/format/format.ts +++ b/src/core/course/components/format/format.ts @@ -257,14 +257,14 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { let j; for (j = i - 1; j >= 1; j--) { - if (!(this.sections[j].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { + if (this.sections[j].uservisible !== false && this.sections[j].hasContent) { break; } } this.previousSection = j >= 1 ? this.sections[j] : null; for (j = i + 1; j < this.sections.length; j++) { - if (!(this.sections[j].visible === 0 || this.sections[j].uservisible === false) && this.sections[j].hasContent) { + if (this.sections[j].uservisible !== false && this.sections[j].hasContent) { break; } } diff --git a/src/core/course/pages/section-selector/section-selector.ts b/src/core/course/pages/section-selector/section-selector.ts index ff76889fc..82a4241c8 100644 --- a/src/core/course/pages/section-selector/section-selector.ts +++ b/src/core/course/pages/section-selector/section-selector.ts @@ -47,7 +47,7 @@ export class CoreCourseSectionSelectorPage { * @param {any} section Selected section object. */ selectSection(section: any): void { - if (!(section.visible === 0 || section.uservisible === false)) { + if (section.uservisible !== false) { this.viewCtrl.dismiss(section); } }