From c4e75a7075a2a7d4726475a37d11acb4b1eec5fa Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Sun, 20 May 2018 14:08:45 -0700 Subject: Fix tests --- .../components/pages/add-token/add-token.component.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'ui/app') diff --git a/ui/app/components/pages/add-token/add-token.component.js b/ui/app/components/pages/add-token/add-token.component.js index 885c7b2ac..0677b4317 100644 --- a/ui/app/components/pages/add-token/add-token.component.js +++ b/ui/app/components/pages/add-token/add-token.component.js @@ -139,17 +139,12 @@ class AddToken extends Component { } async attemptToAutoFillTokenParams (address) { - const { symbol, decimals } = await this.tokenInfoGetter(address) - - if (symbol && decimals) { - this.setState({ - customSymbol: symbol, - customDecimals: decimals, - customSymbolError: null, - customDecimalsError: null, - autoFilled: true, - }) - } + const { symbol = '', decimals = 0 } = await this.tokenInfoGetter(address) + + const autoFilled = Boolean(symbol && decimals) + this.setState({ autoFilled }) + this.handleCustomSymbolChange(symbol || '') + this.handleCustomDecimalsChange(decimals) } handleCustomAddressChange (value) { -- cgit v1.2.3