funds: improve hav change handling
authorGalen Charlton <gmc@equinoxOLI.org>
Wed, 2 Jun 2021 22:06:59 +0000 (18:06 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 2 Jun 2021 22:06:59 +0000 (18:06 -0400)
LH#46

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds.component.ts

index f40a780..92b2a70 100644 (file)
@@ -39,8 +39,13 @@ export class FundsComponent implements OnInit {
     // Changing a tab in the UI means clearing the route (e.g.,
     // if we originally navigated vi funds/fund/:id or
     // funds/funding_source/:id
-    // This is pretty much only cosmetic
     onNavChange(evt: NgbNavChangeEvent) {
+        // clear any IDs parsed from the original route
+        // to avoid reopening the fund or funding source
+        // dialogs when navigating back to the fund/funding source
+        // tab.
+        this.fundId = null;
+        this.fundingSourceId = null;
         const url = this.router.createUrlTree(['/staff/admin/acq/funds']).toString();
         this.location.go(url); // go without reloading
     }