Optimize BallotCard (#211)

This commit is contained in:
varasev 2019-11-04 16:55:41 +03:00 committed by GitHub
parent 1cecd5d169
commit 795472ec57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -320,6 +320,10 @@ export class BallotCard extends React.Component {
@action('validator has already voted')
getHasAlreadyVoted = async () => {
const { contractsStore, id, votingType } = this.props
if (contractsStore.miningKey === '0x0000000000000000000000000000000000000000') {
this.hasAlreadyVoted = false
return
}
let _hasAlreadyVoted = false
try {
_hasAlreadyVoted = await this.getContract(contractsStore, votingType).hasAlreadyVoted(