mirror of
https://github.com/trezor/trezor-wallet
synced 2025-07-01 04:12:40 +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 selectedCoin = this.props.coin;
|
||||||
const fiatRate: any = this.props.fiat.find(f => f.network === selectedCoin.network);
|
const fiatRate: any = this.props.fiat.find(f => f.network === selectedCoin.network);
|
||||||
|
|
||||||
const accountBalance = new BigNumber(this.props.balance);
|
let accountBalance = '';
|
||||||
const fiatRateValue = new BigNumber(fiatRate.value);
|
let fiatRateValue = '';
|
||||||
const fiat = accountBalance.times(fiatRateValue).toFixed(2);
|
let fiat = '';
|
||||||
|
if (fiatRate) {
|
||||||
|
accountBalance = new BigNumber(this.props.balance);
|
||||||
|
fiatRateValue = new BigNumber(fiatRate.value);
|
||||||
|
fiat = accountBalance.times(fiatRateValue).toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user