mirror of
https://github.com/status-im/wakuconnect-vote-poll-sdk.git
synced 2025-02-23 23:58:14 +00:00
Do not allow to vote without selecting an answer
This commit is contained in:
parent
b1ef502e95
commit
2634f8ff91
@ -55,12 +55,12 @@ export function Poll({ poll, wakuPolling, theme, account }: PollProps) {
|
||||
</PollAnswersWrapper>
|
||||
{userInVoters < 0 && (
|
||||
<SmallButton
|
||||
disabled={!account}
|
||||
disabled={!account || selectedAnswer === undefined}
|
||||
onClick={async () => {
|
||||
if (wakuPolling && account) {
|
||||
if (wakuPolling && account && selectedAnswer !== undefined) {
|
||||
const result = await wakuPolling.sendTimedPollVote(
|
||||
poll.poll.id,
|
||||
selectedAnswer ?? 0,
|
||||
selectedAnswer,
|
||||
poll.poll.pollType === PollType.WEIGHTED ? BigNumber.from(tokenAmount) : undefined
|
||||
)
|
||||
if (result === 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user