From 8dbe196d3b7ba435a5282f8e05abfec007166360 Mon Sep 17 00:00:00 2001 From: Gopi Kishan Date: Fri, 14 Mar 2025 04:28:11 +0530 Subject: [PATCH] WEB-28 Fixed issue with loan account approval not working (#2317) --- .../loan-account-actions.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts index 9e9d98c57..41345cf0c 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts @@ -99,7 +99,10 @@ export class LoanAccountActionsComponent { private route: ActivatedRoute, private router: Router ) { - this.navigationData = this.router.getCurrentNavigation().extras.state.data; + const currentNavigation = this.router.getCurrentNavigation(); + // Safely access data with optional chaining + this.navigationData = currentNavigation?.extras?.state?.data; + this.route.data.subscribe((data: { actionButtonData: any }) => { this.actionButtonData = data.actionButtonData; }); @@ -110,9 +113,9 @@ export class LoanAccountActionsComponent { this.actionName = 'Assign Loan Officer'; } for (const key of Object.keys(this.actions)) { - this.actions[key] = false; + this.actions[key as keyof typeof this.actions] = false; } - this.actions[this.actionName] = true; + this.actions[this.actionName as keyof typeof this.actions] = true; }); } }