From 83efd2e22e02909766294d2a085e6b62bcb40b5c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 5 Oct 2018 13:29:08 +0300 Subject: [PATCH] display dxTokenBalance even if tokenBalance == 0 (#388) --- src/components/MenuWallet/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/MenuWallet/index.tsx b/src/components/MenuWallet/index.tsx index 13291760..2b1f3321 100644 --- a/src/components/MenuWallet/index.tsx +++ b/src/components/MenuWallet/index.tsx @@ -92,17 +92,21 @@ export class MenuWallet extends React.Component { {Object.keys(tokens).map((addressKey: any) => { if (!addressToSymbolDecimal[addressKey]) return null const { name, decimals } = addressToSymbolDecimal[addressKey] + const tokenBalAvailable = tokens[addressKey].gt(0) + const dxTokenAvailable = dxBalances[addressKey] + const dxTokenBalAvailable = dxTokenAvailable && dxBalances[addressKey].gt(0) + return ( - tokens[addressKey].gt(0) && + (tokenBalAvailable || dxTokenBalAvailable) && {name || 'Unknown'} {(tokens[addressKey]).div(10 ** decimals).toFixed(FIXED_DECIMALS)} {// Conditionally render dxBalances column dxBalancesAvailable && - - {dxBalances[addressKey] && dxBalances[addressKey].div(10 ** decimals).toFixed(FIXED_DECIMALS)} - {dxBalances[addressKey] && dxBalances[addressKey].gt(0) && + + {dxTokenAvailable && dxBalances[addressKey].div(10 ** decimals).toFixed(FIXED_DECIMALS)} + {dxTokenBalAvailable && withdrawFromDutchX({ name, address: addressKey })}