{{ title }}
{{ message }}
diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts
index 027317b975..866a70ec46 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts
+++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/compass-page/rof-compass-page.component.ts
@@ -81,8 +81,12 @@ async getOrientation() {
handler(e, self) {
if (self.reportOfFire?.headingDetectionActive){
if (!e.alpha && !e.webkitCompassHeading){
+ this.motionSensor = false;
this.skip()
}
+ else {
+ this.motionSensor = true;
+ }
try {
let compassHeading = e.webkitCompassHeading || Math.abs(e.alpha - 360);
diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/complex-question-page/rof-complex-question-page.component.ts b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/complex-question-page/rof-complex-question-page.component.ts
index d809efabc5..fe76eb08aa 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/complex-question-page/rof-complex-question-page.component.ts
+++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/complex-question-page/rof-complex-question-page.component.ts
@@ -115,8 +115,16 @@ export class RoFComplexQuestionPage extends RoFPage {
}
previousPage() {
- if (this.id === 'distance-page') this.reportOfFire.headingDetectionActive = true;
- this.previous();
+ if (this.id === 'distance-page'){
+ this.reportOfFire.headingDetectionActive = true;
+ if (this.motionSensor) {
+ this.previous();
+ } else{
+ this.reportOfFirePage.selectPage('callback-page',null,false)
+ }
+ } else {
+ this.previous();
+ }
}
}
diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/rofPage.ts b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/rofPage.ts
index 1fdf78161d..3cdf63483c 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/rofPage.ts
+++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/rofPage.ts
@@ -30,6 +30,7 @@ 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;
@@ -48,6 +49,7 @@ export class RoFPage {
this.previousId = data.previousId || null;
this.nextId = data.nextId || null;
this.skipId = data.skipId || null;
+ this.motionSensor = false;
}
previous () {
diff --git a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/simple-question-page/rof-simple-question-page.component.ts b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/simple-question-page/rof-simple-question-page.component.ts
index a4aa747745..125c483c5f 100644
--- a/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/simple-question-page/rof-simple-question-page.component.ts
+++ b/client/wfnews-war/src/main/angular/src/app/components/report-of-fire/simple-question-page/rof-simple-question-page.component.ts
@@ -87,12 +87,24 @@ export class RoFSimpleQuestionPage extends RoFPage {
}
nextPage(){
- if (this.id === 'callback-page') this.reportOfFire.headingDetectionActive = true;
- this.next();
+ if (this.id === 'callback-page') {
+ this.reportOfFire.headingDetectionActive = true;
+ this.next();
+ }
}
skipPage(){
- if (this.id === 'callback-page') this.reportOfFire.headingDetectionActive = true;
- this.skip();
+ if (this.id === 'callback-page') {
+ this.reportOfFire.headingDetectionActive = true;
+ if (this.motionSensor) {
+ this.skip();
+ } else {
+ this.reportOfFirePage.selectPage('distance-page',null,false);
+ }
+ }
+ else{
+ this.skip();
+
+ }
}
}