From 42622b784894d4d696a6c902f182b85fcfa39931 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Wed, 28 Aug 2024 11:47:35 +0300 Subject: [PATCH] resolve confilicts --- src/pages/Permissions/Permissions.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/Permissions/Permissions.tsx b/src/pages/Permissions/Permissions.tsx index db22f46..4766fcb 100644 --- a/src/pages/Permissions/Permissions.tsx +++ b/src/pages/Permissions/Permissions.tsx @@ -24,13 +24,21 @@ export function Permissions() { AccessData[] >([]); - const { data, isLoading: isLoadingApplications } = useReadContract({ + const { + data, + isLoading: isLoadingApplications, + error, + } = useReadContract({ abi: sepoliaChainAppConctract.appContractABI, address: sepoliaChainAppConctract.appContractAddress as Address, functionName: 'getApplications', args: applicationsArgs, }); + if (error) { + throw new Error('Error fetching applications'); + } + const applications = useMemo( () => (data as { name: string; account: string }[]) || [], [data] @@ -123,9 +131,9 @@ export function Permissions() { }, [hasPermissionsOnApp, attestations, applications]); const providers: Platform[] = attestations.map((attestation) => ({ - id: attestation.id || '', + id: attestation.id || 'Unknown', provider: attestation.provider || 'Unknown', - uid: attestation.id || '', + uid: attestation.id || 'Unknown', })); const handleGrantOrRevokeAccess = (application: any, platform: any) => {