Signed-off-by: Bill Erickson <berickxx@gmail.com>
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);
});
}