From 1728b952aecda652e4f477689f490e083a9d915c Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 13 Jul 2022 02:28:45 +0000 Subject: [PATCH] LP#1942220: (follow-up) add a bit more caching Funds in the fund cache in the liService will be checked first. Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.ts index aca110d66d..5874573731 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/copy-attrs.component.ts @@ -182,6 +182,9 @@ export class LineitemCopyAttrsComponent implements OnInit { } checkFundBalance(fundId: number): string { + if (this.liService.fundCache[fundId] && this.liService.fundCache[fundId]._balance) { + return this.liService.fundCache[fundId]._balance; + } if (this._fundBalanceCache[fundId]) { return this._fundBalanceCache[fundId]; } @@ -200,6 +203,9 @@ export class LineitemCopyAttrsComponent implements OnInit { } else { this._fundBalanceCache[fundId] = 'ok'; } + if (this.liService.fundCache[fundId]) { + this.liService.fundCache[fundId]['_balance'] = this._fundBalanceCache[fundId]; + } delete this._inflight[fundId]; return this._fundBalanceCache[fundId]; }); -- 2.11.0