diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-05-21 05:08:45 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-05-21 05:08:45 +0800 |
commit | c4e75a7075a2a7d4726475a37d11acb4b1eec5fa (patch) | |
tree | ec71547c635b90b12c87ad72a463dd866c22a079 /ui/app/components | |
parent | 4f6b53c1aa383c05fa3c356adb332fcc6dbf45e9 (diff) | |
download | tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.tar tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.tar.gz tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.tar.bz2 tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.tar.lz tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.tar.xz tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.tar.zst tangerine-wallet-browser-c4e75a7075a2a7d4726475a37d11acb4b1eec5fa.zip |
Fix tests
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/pages/add-token/add-token.component.js | 17 |
1 files changed, 6 insertions, 11 deletions
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) { |