diff --git a/api/routes/accounts/index.mjs b/api/routes/accounts/index.mjs index 63008ab4..05afcd14 100644 --- a/api/routes/accounts/index.mjs +++ b/api/routes/accounts/index.mjs @@ -28,11 +28,15 @@ router.get('/:address', async (req, res) => { return res.status(200).send(cachedAccount) } - const accountInfo = await rpc.accountInfo({ - account: address, - pending: true, - representative: true - }) + const [account_weight, accountInfo] = await Promise.all([ + rpc.accountWeight({ account: address }), + rpc.accountInfo({ + account: address, + pending: true, + representative: true, + weight: true + }) + ]) const data = { account: address, @@ -46,7 +50,7 @@ router.get('/:address', async (req, res) => { pending: BigNumber(accountInfo.pending).toNumber(), balance: BigNumber(accountInfo.balance).toNumber(), block_count: BigNumber(accountInfo.block_count).toNumber(), - weight: BigNumber(accountInfo.weight).toNumber(), + weight: BigNumber(account_weight.weight).toNumber(), confirmation_height: BigNumber( accountInfo.confirmation_height ).toNumber() diff --git a/src/views/components/representative-info/representative-info.js b/src/views/components/representative-info/representative-info.js index f9521124..c660117f 100644 --- a/src/views/components/representative-info/representative-info.js +++ b/src/views/components/representative-info/representative-info.js @@ -39,9 +39,11 @@ export default class RepresentativeNetwork extends React.Component { Weight Represented
- {BigNumber(account.getIn(['account_meta', 'weight'])) - .shiftedBy(-30) - .toFormat(0)} + {account.getIn(['account_meta', 'weight']) + ? BigNumber(account.getIn(['account_meta', 'weight'])) + .shiftedBy(-30) + .toFormat(0) + : '-'}
{rows}