From c6907fd6676c3ec1fdc8569f889f2c0ea986646a Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Wed, 12 Feb 2025 19:32:26 -0800 Subject: [PATCH] Remove unused stuff --- components/groups/modals/voteDetailsModal.tsx | 6 +--- components/groups/modals/voteModal.tsx | 32 ------------------- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/components/groups/modals/voteDetailsModal.tsx b/components/groups/modals/voteDetailsModal.tsx index 0fbadf9..7caf2ef 100644 --- a/components/groups/modals/voteDetailsModal.tsx +++ b/components/groups/modals/voteDetailsModal.tsx @@ -297,8 +297,8 @@ function VoteDetailsModal({ 'vote-details-modal' ); } catch (error) { - console.error('Failed to vote: ', error); setIsSigning(false); + console.error('Failed to vote: ', error); } }; @@ -347,10 +347,6 @@ function VoteDetailsModal({ } }; - const executeVote = async () => { - setIsSigning(true); - }; - const optionToVote = (option: string) => { switch (option) { case 'VOTE_OPTION_YES': diff --git a/components/groups/modals/voteModal.tsx b/components/groups/modals/voteModal.tsx index 7047687..d2f93a9 100644 --- a/components/groups/modals/voteModal.tsx +++ b/components/groups/modals/voteModal.tsx @@ -21,39 +21,8 @@ function VotingPopup({ const { estimateFee } = useFeeEstimation(env.chain); const { tx, isSigning, setIsSigning } = useTx(env.chain); const { address } = useChain(env.chain); - const [error, setError] = useState(null); - const { vote } = cosmos.group.v1.MessageComposer.withTypeUrl; - const handleVote = async (option: number) => { - const msg = vote({ - proposalId: proposal.id, - voter: address ?? '', - option: option, - metadata: '', - exec: 0, - }); - - const fee = await estimateFee(address ?? '', [msg]); - try { - await tx( - [msg], - { - fee, - onSuccess: () => { - closeModal(); - setIsSigning(false); - }, - }, - 'votingPrompt' - ); - } catch (error) { - console.error('Failed to vote: ', error); - setError('Failed to cast vote. Please try again.'); - setIsSigning(false); - } - }; - const closeModal = (vote?: number) => { onClose(vote); }; @@ -73,7 +42,6 @@ function VotingPopup({

Cast Your Vote for Proposal #{proposal.id.toString()}

- {error &&
{error}
}
{isSigning ? (