1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-23 23:48:07 +00:00

Fix bug causing fiatRate be undefined

This commit is contained in:
Vasek Mlejnsky 2018-08-30 22:42:51 +02:00
parent a8d3fccfa7
commit 78f6684fa7

View File

@ -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>