Skip to content

Commit

Permalink
change the motionsensor value to string
Browse files Browse the repository at this point in the history
  • Loading branch information
yzlucas committed Oct 12, 2023
1 parent 2fc62ee commit a733333
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-content" *ngIf="reportOfFire.motionSensor">
<div class="page-content" *ngIf="reportOfFire.motionSensor === 'yes'">
<div class="rof-text-primary-header">{{ title }}</div>
<div class="rof-text-secondary-header">{{ message }}</div>
<div id="compass-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ async getOrientation() {
handler(e, self) {
if (self.reportOfFire?.headingDetectionActive){
if (!e.alpha && !e.webkitCompassHeading){
this.reportOfFire.motionSensor = false;
this.reportOfFire.motionSensor = 'no';
this.skip()
}
else {
this.reportOfFire.motionSensor = true;
this.reportOfFire.motionSensor = 'yes';
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class RoFComplexQuestionPage extends RoFPage {
previousPage() {
if (this.id === 'distance-page'){
this.reportOfFire.headingDetectionActive = true;
if (this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'yes') {
this.previous();
} else{
this.reportOfFirePage.selectPage('callback-page',null,false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class RoFContactPage extends RoFPage {
}

nextPage() {
if (this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'yes') {
this.next();
} else{
this.reportOfFirePage.selectPage('distance-page',null,false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class ReportOfFirePage implements OnInit, AfterContentInit {
skip () {
if (this.currentPage.instance.id === 'callback-page' || this.currentPage.instance.id === 'contact-page') {
this.reportOfFire.headingDetectionActive = true;
if (!this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'no') {
this.selectPage('distance-page',null,false);
} else {
this.currentPage.instance.skip();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ export class ReportOfFire {
public currentLocation: Array<number> = [0, 0];
public compassHeading: number = 0;
public headingDetectionActive: boolean;
public motionSensor: boolean;
public motionSensor: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class RoFPage {
public updateAttribute: string;
public showProgress: boolean;
public allowMultiSelect: boolean;
public motionSensor: boolean;

initialize (data: any, index: number, reportOfFire: ReportOfFire) {
this.allowExit = data.allowExit;
Expand All @@ -49,7 +48,6 @@ export class RoFPage {
this.previousId = data.previousId || null;
this.nextId = data.nextId || null;
this.skipId = data.skipId || null;
this.motionSensor = false;
}

previous () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class RoFSimpleQuestionPage extends RoFPage {
skipPage(){
if (this.id === 'callback-page') {
this.reportOfFire.headingDetectionActive = true;
if (this.reportOfFire.motionSensor) {
if (this.reportOfFire.motionSensor === 'yes') {
this.skip();
} else {
this.reportOfFirePage.selectPage('distance-page',null,false);
Expand Down

0 comments on commit a733333

Please sign in to comment.