Skip to content

Commit

Permalink
Fix for orgDid missing value (#831)
Browse files Browse the repository at this point in the history
* Fix for orgDid missing value

Signed-off-by: prasadgkalamkar <[email protected]>

* CREDEBL-176: optional chaining added

Signed-off-by: prasadgkalamkar <[email protected]>

* optional chaining corrected

Signed-off-by: prasadgkalamkar <[email protected]>

* refactored logic for orgAgentList and orgDid

Signed-off-by: prasadgkalamkar <[email protected]>

---------

Signed-off-by: prasadgkalamkar <[email protected]>
  • Loading branch information
prasadgkalamkar authored Dec 3, 2024
1 parent 7a06c65 commit fc2d42c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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?.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);
};
Expand Down

0 comments on commit fc2d42c

Please sign in to comment.