From 5a0a985789ec888ff431a73b9c8ac9d2d72f371d Mon Sep 17 00:00:00 2001 From: prasadgkalamkar Date: Tue, 3 Dec 2024 17:48:44 +0530 Subject: [PATCH] refactored logic for orgAgentList and orgDid Signed-off-by: prasadgkalamkar --- src/components/User/UserDashBoard.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/User/UserDashBoard.tsx b/src/components/User/UserDashBoard.tsx index 980847a7..ee3b53c9 100644 --- a/src/components/User/UserDashBoard.tsx +++ b/src/components/User/UserDashBoard.tsx @@ -273,15 +273,17 @@ const UserDashBoard = () => { const response = await getOrganizationById(orgId); const { data } = response as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - const orgDid = data?.org_agents?.[0].orgDid; - if (data?.data?.org_agents) { + const orgAgentsList = data?.data?.org_agents; + if (orgAgentsList && orgAgentsList.length > 0) { + const orgDid = orgAgentsList[0].orgDid; setWalletData(data?.data?.org_agents); + + if(orgDid?.includes(DidMethod.INDY)){ + setIsW3C(false); + } } else { setWalletData([]); } - if(orgDid?.includes(DidMethod.INDY)){ - setIsW3C(false); - } } setWalletLoading(false); };