From 99c2073676a99de05c47d796063dca50df80e706 Mon Sep 17 00:00:00 2001 From: Kristofer Date: Mon, 4 Sep 2023 09:28:39 +0200 Subject: [PATCH] Show Safe error to user --- .../components/CreateAttestationsButton.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/pages/PeriodDetails/components/CreateAttestationsButton.tsx b/packages/frontend/src/pages/PeriodDetails/components/CreateAttestationsButton.tsx index 3b158299a..8583ac508 100644 --- a/packages/frontend/src/pages/PeriodDetails/components/CreateAttestationsButton.tsx +++ b/packages/frontend/src/pages/PeriodDetails/components/CreateAttestationsButton.tsx @@ -20,7 +20,7 @@ export function CreateAttestationsButton({ // Hooks const { periodId } = useParams(); const { address } = useAccount(); - const { safe } = useSafe(); + const { safe, safeError } = useSafe(); // Global state const period = useRecoilValue(SinglePeriod(periodId)); @@ -44,6 +44,19 @@ export function CreateAttestationsButton({ const disabled = !userId || !address; + if (safeError) { + return ( +
+
+ Error: {safeError.message} +
+
+ Make sure the community creator address is valid Safe account address. +
+
+ ); + } + if (address && typeof isOwner === 'undefined') { return (