LP1929741 Ensure PO items always display when present
authorBill Erickson <berickxx@gmail.com>
Mon, 1 Feb 2021 21:16:07 +0000 (16:16 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 26 May 2021 18:37:30 +0000 (14:37 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
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;