Skip to content

Commit

Permalink
Fix zero ECHO asset view
Browse files Browse the repository at this point in the history
  • Loading branch information
doomdabidon committed Apr 4, 2020
1 parent f26d8a0 commit 872204b
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions src/components/Wallet/AssetsComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,42 @@ class Assets extends React.Component {
this.setState({ focusedId: null });
}

setAsset(symbol) {
setAsset(asset) {
this.props.setGlobalValue('activeCoinTypeTab', 0);
this.props.setAsset(symbol);
this.props.setAsset(asset);
}

renderEmpty() {
renderItem(asset, id) {
return (
<li>
<button onClick={() => this.props.setAsset('ECHO')}>
<span className="currency-symbol">ECHO</span>
<span className="currency-amount">0</span>
<li
key={id}
className={classnames({ focused: id === this.state.focusedId })}
>
<button
className="balance-item"
onFocus={() => this.onFocus(id)}
onBlur={() => this.onBlur()}
onClick={() => this.setAsset(asset)}
>
<span className="currency-symbol">{asset.symbol}</span>
<span className="currency-amount">
{formatAmount(asset.balance, asset.precision, '')}
</span>
</button>
</li>
);
}

renderEmpty() {
return this.renderItem({ symbol: 'ECHO', balance: '0', precision: 8 }, 0);
}

renderList() {

return (
this.props.assets.map((asset, i) => {
const id = i;
return (
<li
key={id}
className={classnames({ focused: id === this.state.focusedId })}
>
<button
className="balance-item"
onFocus={() => this.onFocus(id)}
onBlur={() => this.onBlur()}
onClick={() => this.setAsset(asset)}
>
<span className="currency-symbol">{asset.symbol}</span>
<span className="currency-amount">
{formatAmount(asset.balance, asset.precision, '')}
</span>
</button>
</li>
);

return this.renderItem(asset, id);
})
);
}
Expand Down

0 comments on commit 872204b

Please sign in to comment.