From d353c805ca32eaeb9de87dea1030d6f398d2174d Mon Sep 17 00:00:00 2001 From: Vu Pham Date: Thu, 13 Jun 2019 17:43:57 +0700 Subject: [PATCH] remove candidate name if tx is withdraw --- apis/transactions.js | 5 ++++- app/assets/scss/components/_navbar.scss | 1 + app/components/voters/View.vue | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apis/transactions.js b/apis/transactions.js index fefe4f6f..08024579 100644 --- a/apis/transactions.js +++ b/apis/transactions.js @@ -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({ diff --git a/app/assets/scss/components/_navbar.scss b/app/assets/scss/components/_navbar.scss index 0182c9d8..3c849fbe 100644 --- a/app/assets/scss/components/_navbar.scss +++ b/app/assets/scss/components/_navbar.scss @@ -135,6 +135,7 @@ a { text-align: center; text-decoration: none; + white-space: pre-wrap; cursor: pointer; &:hover { diff --git a/app/components/voters/View.vue b/app/components/voters/View.vue index bafcdc52..e994b89c 100644 --- a/app/components/voters/View.vue +++ b/app/components/voters/View.vue @@ -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()) || '---' }) })