aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/token-input/token-input.component.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-11-21 06:44:28 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-11-21 06:44:28 +0800
commit9b1df386de908ae14e0ce169f1231a0d6de77972 (patch)
treed7fc663343b7ba3c28dff0022ca018a01bea451c /ui/app/components/token-input/token-input.component.js
parentc0557b43e2c493de73c8bf74cfa9e5740c8cfd3f (diff)
parent5956f8d260270d41f1e5be53f3c058782a1ae7f4 (diff)
downloadtangerine-wallet-browser-9b1df386de908ae14e0ce169f1231a0d6de77972.tar.gz
tangerine-wallet-browser-9b1df386de908ae14e0ce169f1231a0d6de77972.tar.zst
tangerine-wallet-browser-9b1df386de908ae14e0ce169f1231a0d6de77972.zip
fix merge conflicts
Diffstat (limited to 'ui/app/components/token-input/token-input.component.js')
-rw-r--r--ui/app/components/token-input/token-input.component.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/app/components/token-input/token-input.component.js b/ui/app/components/token-input/token-input.component.js
index d1388945b..10fa1151e 100644
--- a/ui/app/components/token-input/token-input.component.js
+++ b/ui/app/components/token-input/token-input.component.js
@@ -32,7 +32,7 @@ export default class TokenInput extends PureComponent {
super(props)
const { value: hexValue } = props
- const decimalValue = hexValue ? this.getDecimalValue(props) : 0
+ const decimalValue = hexValue ? this.getValue(props) : 0
this.state = {
decimalValue,
@@ -46,12 +46,12 @@ export default class TokenInput extends PureComponent {
const { hexValue: stateHexValue } = this.state
if (prevPropsHexValue !== propsHexValue && propsHexValue !== stateHexValue) {
- const decimalValue = this.getDecimalValue(this.props)
+ const decimalValue = this.getValue(this.props)
this.setState({ hexValue: propsHexValue, decimalValue })
}
}
- getDecimalValue (props) {
+ getValue (props) {
const { value: hexValue, selectedToken: { decimals, symbol } = {} } = props
const multiplier = Math.pow(10, Number(decimals || 0))
@@ -63,7 +63,7 @@ export default class TokenInput extends PureComponent {
invertConversionRate: true,
})
- return Number(decimalValueString) || 0
+ return Number(decimalValueString) ? decimalValueString : ''
}
handleChange = decimalValue => {