diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-25 07:43:03 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-25 07:43:03 +0800 |
commit | 98d8275743344826e81ee59ba7435ca75b43f2cd (patch) | |
tree | d6b38896445d52a81e5a72a917c4aeb2a90eda03 /ui/app/components/bn-as-decimal-input.js | |
parent | ae56b865e8a4d3a6a82a97efeca34b8a592c985b (diff) | |
download | tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.tar tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.tar.gz tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.tar.bz2 tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.tar.lz tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.tar.xz tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.tar.zst tangerine-wallet-browser-98d8275743344826e81ee59ba7435ca75b43f2cd.zip |
Fix for gas price to be lowered.
Diffstat (limited to 'ui/app/components/bn-as-decimal-input.js')
-rw-r--r-- | ui/app/components/bn-as-decimal-input.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/app/components/bn-as-decimal-input.js b/ui/app/components/bn-as-decimal-input.js index d84834d06..db5af1f46 100644 --- a/ui/app/components/bn-as-decimal-input.js +++ b/ui/app/components/bn-as-decimal-input.js @@ -31,6 +31,8 @@ BnAsDecimalInput.prototype.render = function () { const suffix = props.suffix const style = props.style const valueString = value.toString(10) + const newMin = min && this.downsize(min.toString(10), scale) + const newMax = max && this.downsize(max.toString(10), scale) const newValue = this.downsize(valueString, scale) return ( @@ -47,8 +49,8 @@ BnAsDecimalInput.prototype.render = function () { type: 'number', step: 'any', required: true, - min, - max, + min: newMin, + max: newMax, style: extend({ display: 'block', textAlign: 'right', @@ -128,15 +130,15 @@ BnAsDecimalInput.prototype.updateValidity = function (event) { } BnAsDecimalInput.prototype.constructWarning = function () { - const { name, min, max } = this.props + const { name, min, max, scale } = this.props let message = name ? name + ' ' : '' if (min && max) { - message += `must be greater than or equal to ${min} and less than or equal to ${max}.` + message += `must be greater than or equal to ${this.downsize(min.toString(10), scale)} and less than or equal to ${this.downsize(max.toString(10), scale)}.` } else if (min) { - message += `must be greater than or equal to ${min}.` + message += `must be greater than or equal to ${this.downsize(min.toString(10), scale)}.` } else if (max) { - message += `must be less than or equal to ${max}.` + message += `must be less than or equal to ${this.downsize(max.toString(10), scale)}.` } else { message += 'Invalid input.' } |