Skip to content

Commit

Permalink
Show Safe error to user
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferlund committed Sep 4, 2023
1 parent 40a5b40 commit 99c2073
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function CreateAttestationsButton({
// Hooks
const { periodId } = useParams<PeriodPageParams>();
const { address } = useAccount();
const { safe } = useSafe();
const { safe, safeError } = useSafe();

// Global state
const period = useRecoilValue(SinglePeriod(periodId));
Expand All @@ -44,6 +44,19 @@ export function CreateAttestationsButton({

const disabled = !userId || !address;

if (safeError) {
return (
<div>
<div>
<strong>Error:</strong> {safeError.message}
</div>
<div>
Make sure the community creator address is valid Safe account address.
</div>
</div>
);
}

if (address && typeof isOwner === 'undefined') {
return (
<div>
Expand Down

0 comments on commit 99c2073

Please sign in to comment.