Use helper function to check for error

This commit is contained in:
Steve Klebanoff
2018-12-12 15:46:46 -08:00
parent 9e5e1f568b
commit 2e7d363f2c

View File

@@ -85,9 +85,7 @@ export class OrderDetails extends React.Component<OrderDetailsProps> {
const canDisplayCurrency = const canDisplayCurrency =
secondaryCurrency === BaseCurrency.ETH || secondaryCurrency === BaseCurrency.ETH ||
(secondaryCurrency === BaseCurrency.USD && (secondaryCurrency === BaseCurrency.USD && this.props.ethUsdPrice && !this._hadErrorFetchingUsdPrice);
this.props.ethUsdPrice &&
this.props.ethUsdPrice.greaterThan(BIG_NUMBER_ZERO));
if (this.props.buyQuoteInfo && canDisplayCurrency) { if (this.props.buyQuoteInfo && canDisplayCurrency) {
return this._displayAmount(secondaryCurrency, this.props.buyQuoteInfo.totalEthAmount); return this._displayAmount(secondaryCurrency, this.props.buyQuoteInfo.totalEthAmount);