Skip to content

Commit

Permalink
close on rejection of signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut committed Sep 5, 2023
1 parent aba72c9 commit 7e5f11d
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions packages/ui/src/components/modals/WalletConnectSigning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,16 @@ const ProposalSigning = ({ onClose, className, request, onSuccess }: SigningModa
)

const onReject = useCallback(() => {
const response = {
id: request.id,
jsonrpc: '2.0',
error: {
code: 5000,
message: 'User rejected request on Multix'
}
}
web3wallet?.respondSessionRequest({
topic: request.topic,
response
})
}, [request.id, request.topic, web3wallet])
const response = getWalletConnectErrorResponse(request.id, 'User rejected request on Multix')

web3wallet
?.respondSessionRequest({
topic: request.topic,
response
})
.catch(console.error)
.finally(() => onClose())
}, [onClose, request, web3wallet])

return (
<Dialog
Expand Down Expand Up @@ -306,7 +303,7 @@ const ProposalSigning = ({ onClose, className, request, onSuccess }: SigningModa
onClick={onSign}
disabled={!!errorMessage || isSubmitting || !callInfo?.call}
>
Approve
Sign
</Button>
</>
)}
Expand Down

0 comments on commit 7e5f11d

Please sign in to comment.