mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-24 16:08:11 +00:00
Fix bug causing fiatRate be undefined
This commit is contained in:
parent
a8d3fccfa7
commit
78f6684fa7
@ -87,9 +87,15 @@ class AccountBalance extends Component<Props, State> {
|
||||
const selectedCoin = this.props.coin;
|
||||
const fiatRate: any = this.props.fiat.find(f => f.network === selectedCoin.network);
|
||||
|
||||
const accountBalance = new BigNumber(this.props.balance);
|
||||
const fiatRateValue = new BigNumber(fiatRate.value);
|
||||
const fiat = accountBalance.times(fiatRateValue).toFixed(2);
|
||||
let accountBalance = '';
|
||||
let fiatRateValue = '';
|
||||
let fiat = '';
|
||||
if (fiatRate) {
|
||||
accountBalance = new BigNumber(this.props.balance);
|
||||
fiatRateValue = new BigNumber(fiatRate.value);
|
||||
fiat = accountBalance.times(fiatRateValue).toFixed(2);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
|
Loading…
Reference in New Issue
Block a user