Optimize BallotCard

This commit is contained in:
Vadim 2019-11-01 18:15:09 +03:00
parent 1cecd5d169
commit 243c0fa100
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(