From d661f0ff5ff96afdde07aa3004a8928a8ac5be14 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Mon, 29 Jan 2018 12:23:39 -0600 Subject: [PATCH] Handle unsupported units in EquivalentValues (#939) --- common/components/BalanceSidebar/EquivalentValues.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/components/BalanceSidebar/EquivalentValues.tsx b/common/components/BalanceSidebar/EquivalentValues.tsx index 4a473130..f09a1154 100644 --- a/common/components/BalanceSidebar/EquivalentValues.tsx +++ b/common/components/BalanceSidebar/EquivalentValues.tsx @@ -113,6 +113,7 @@ class EquivalentValues extends React.Component { const { equivalentValues, options } = this.state; const isFetching = !balance || balance.isPending || !tokenBalances || Object.keys(rates).length === 0; + const pairRates = this.generateValues(equivalentValues.label, equivalentValues.value); const Value = ({ rate, value }) => (
@@ -159,9 +160,11 @@ class EquivalentValues extends React.Component { ) : (
- {this.generateValues(equivalentValues.label, equivalentValues.value).map((equiv, i) => ( - - ))} + {pairRates.length ? ( + pairRates.map((equiv, i) => ) + ) : ( +

Sorry, equivalent values are not supported for this unit.

+ )}
)}