LPXXX Patron UI WIP
authorBill Erickson <berickxx@gmail.com>
Wed, 12 Aug 2020 22:27:17 +0000 (18:27 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 21 Aug 2020 20:41:27 +0000 (16:41 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts

index 8894b1b..8e034b7 100644 (file)
@@ -36,13 +36,17 @@ export class PatronComponent implements OnInit, AfterViewInit {
             this.patronTab = params.get('tab') || 'search';
             this.patronId = +params.get('id');
 
-            if (!this.patronId || (
-                this.context.patron &&
-                this.context.patron.id() === this.patronId)) {
-                return;
+            const prevId =
+                this.context.patron ? this.context.patron.id() : null;
+
+            if (this.patronId) {
+                if (this.patronId !== prevId) { // different patron
+                    this.context.loadPatron(this.patronId);
+                }
+            } else {
+                // Use the ID of the previously loaded patron.
+                this.patronId = prevId;
             }
-
-            this.context.loadPatron(this.patronId);
         });
     }