Skip to content

Commit

Permalink
Merge pull request #672 from pqv199x/withdraw-name
Browse files Browse the repository at this point in the history
remove candidate name if tx is withdraw
  • Loading branch information
pqv199x authored Jun 14, 2019
2 parents 4386bbb + d353c80 commit 1f6a5bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apis/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ router.get('/voter/:voter', [
smartContractAddress: config.get('blockchain.validatorAddress'),
candidate: t.candidate
}) || {}
c.name = b.name || 'Anonymous'

if (t.event === 'Withdraw') {
c.name = ''
} else { c.name = b.name || 'Anonymous' }
return c
}))
return res.json({
Expand Down
1 change: 1 addition & 0 deletions app/assets/scss/components/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
a {
text-align: center;
text-decoration: none;
white-space: pre-wrap;
cursor: pointer;

&:hover {
Expand Down
2 changes: 1 addition & 1 deletion app/components/voters/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export default {
event: tx.event,
cap: new BigNumber(tx.capacity).div(10 ** 18).toNumber(),
createdAt: moment(tx.createdAt).fromNow(),
name: tx.name,
name: tx.name || '---',
candidateCap: (new BigNumber(tx.currentCandidateCap).div(10 ** 18).toNumber()) || '---'
})
})
Expand Down

0 comments on commit 1f6a5bc

Please sign in to comment.