LP1904036 Patron bills tab honors editor change warning
authorBill Erickson <berickxx@gmail.com>
Thu, 26 Aug 2021 19:03:48 +0000 (15:03 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 6 Oct 2022 17:05:39 +0000 (13:05 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts

index 4917db2..38af2b8 100644 (file)
@@ -176,8 +176,13 @@ export class PatronComponent implements OnInit, AfterViewInit {
     // The bills tab has various sub-interfaces.  If the user is already
     // on the Bills tab and clicks the tab, return them to the main bills
     // screen.
+    // Avoid the navigate call when not on the bills tab because it
+    // interferes with the pre-tab-change "changes pending" confirm dialog
+    // used by the editor and possibily others.
     billsTabClicked() {
-        this.router.navigate(['/staff/circ/patron', this.patronId, 'bills']);
+        if (this.patronTab === 'bills') {
+            this.router.navigate(['/staff/circ/patron', this.patronId, 'bills']);
+        }
     }
 
     routeToTab() {