From 5a2c196462a126646d2ae1e0b76760dd338876ab Mon Sep 17 00:00:00 2001
From: Augustin LECONTE <["ext.sopra.aleconte@grandlyon.com"]>
Date: Mon, 21 Feb 2022 15:37:40 +0000
Subject: [PATCH] fix(print-orientation): progression percentage is 100% when
 printing

---
 src/app/form/orientation-form/orientation-form.component.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/app/form/orientation-form/orientation-form.component.ts b/src/app/form/orientation-form/orientation-form.component.ts
index 0a32de362..31b2c36d0 100644
--- a/src/app/form/orientation-form/orientation-form.component.ts
+++ b/src/app/form/orientation-form/orientation-form.component.ts
@@ -203,8 +203,9 @@ export class OrientationFormComponent implements OnInit {
     if (this.currentPage === 0) {
       this.previousUrl();
     } else {
+      if (this.currentPage == this.nbPagesForm - 1) this.progressStatus -= (100 / this.nbPagesForm) * 2;
+      else this.progressStatus -= 100 / this.nbPagesForm;
       this.currentPage--;
-      this.progressStatus -= 100 / this.nbPagesForm;
       this.setStructuresAndCoord();
       this.updatePageValid();
     }
@@ -532,6 +533,7 @@ export class OrientationFormComponent implements OnInit {
     this.multiPrint = event;
     setTimeout(() => {
       window.print();
+      this.progressStatus = 100;
     }, 1000);
   }
 
-- 
GitLab