From: Bill Erickson <berickxx@gmail.com>
Date: Mon, 1 Feb 2021 21:16:07 +0000 (-0500)
Subject: LP1929741 Ensure PO items always display when present
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=eb55945fc8bded9c87ffb6cdd4b023c22f876439;p=evergreen%2Fequinox.git

LP1929741 Ensure PO items always display when present

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
---

diff --git a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts
index 646b98c419..3087aed6a1 100644
--- a/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts
@@ -21,6 +21,14 @@ export class PoChargesComponent implements OnInit {
     ) {}
 
     ngOnInit() {
+        if (this.po()) {
+            // Sometimes our PO is already available at render time.
+             if (this.po().po_items().length > 0) {
+                this.showBody = true;
+            }
+        }
+
+        // Other times we have to wait for it.
         this.poService.poRetrieved.subscribe(() => {
             if (this.po().po_items().length > 0) {
                 this.showBody = true;