LP1929741 Ensure PO items always display when present
authorBill Erickson <berickxx@gmail.com>
Mon, 1 Feb 2021 21:16:07 +0000 (16:16 -0500)
committerJane Sandberg <js7389@princeton.edu>
Sun, 2 Oct 2022 15:02:49 +0000 (08:02 -0700)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts

index 646b98c..3087aed 100644 (file)
@@ -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;