Fix typo
This commit is contained in:
parent
beae8c2857
commit
7f641c35a6
|
@ -11,7 +11,7 @@ import { WakuMessaging } from './WakuMessaging'
|
|||
import { Web3Provider } from '@ethersproject/providers'
|
||||
import { WakuMessagesSetup } from '../types/WakuMessagesSetup'
|
||||
|
||||
export enum MESSEGAGE_SENDING_RESULT {
|
||||
export enum MESSAGE_SENDING_RESULT {
|
||||
ok = 0,
|
||||
notEnoughToken = 1,
|
||||
errorCreatingMessage = 2,
|
||||
|
@ -76,12 +76,12 @@ export class WakuPolling extends WakuMessaging {
|
|||
const pollInit = await PollInitMsg.create(signer, question, answers, pollType, this.chainId, minToken, endTime)
|
||||
if (pollInit) {
|
||||
await this.sendWakuMessage(this.wakuMessages['pollInit'], pollInit)
|
||||
return MESSEGAGE_SENDING_RESULT.ok
|
||||
return MESSAGE_SENDING_RESULT.ok
|
||||
} else {
|
||||
return MESSEGAGE_SENDING_RESULT.errorCreatingMessage
|
||||
return MESSAGE_SENDING_RESULT.errorCreatingMessage
|
||||
}
|
||||
} else {
|
||||
return MESSEGAGE_SENDING_RESULT.notEnoughToken
|
||||
return MESSAGE_SENDING_RESULT.notEnoughToken
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,13 +96,13 @@ export class WakuPolling extends WakuMessaging {
|
|||
if (pollVote) {
|
||||
await this.sendWakuMessage(this.wakuMessages['pollVote'], pollVote)
|
||||
} else {
|
||||
return MESSEGAGE_SENDING_RESULT.errorCreatingMessage
|
||||
return MESSAGE_SENDING_RESULT.errorCreatingMessage
|
||||
}
|
||||
} else {
|
||||
return MESSEGAGE_SENDING_RESULT.notEnoughToken
|
||||
return MESSAGE_SENDING_RESULT.notEnoughToken
|
||||
}
|
||||
} else {
|
||||
return MESSEGAGE_SENDING_RESULT.pollNotFound
|
||||
return MESSAGE_SENDING_RESULT.pollNotFound
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import styled from 'styled-components'
|
|||
import { PollType } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { Input, addIcon, SmallButton, Modal, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { MESSAGE_SENDING_RESULT } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/classes/WakuPolling'
|
||||
|
||||
function getLocaleIsoTime(dateTime: Date) {
|
||||
const MS_PER_MINUTE = 60000
|
||||
|
@ -92,10 +93,10 @@ export function PollCreation({ wakuPolling, theme, setShowPollCreation }: PollCr
|
|||
undefined,
|
||||
endTimePicker.getTime()
|
||||
)
|
||||
if (result === 0) {
|
||||
if (result === MESSAGE_SENDING_RESULT.ok) {
|
||||
setShowCreateConfirmation(true)
|
||||
}
|
||||
if (result === 1) {
|
||||
if (result === MESSAGE_SENDING_RESULT.notEnoughToken) {
|
||||
setShowNotEnoughTokens(true)
|
||||
}
|
||||
}}
|
||||
|
|
Loading…
Reference in New Issue