diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-26 02:35:18 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-26 02:35:18 +0800 |
commit | e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2 (patch) | |
tree | f4b7c28a2ffc5030b5fe7c65cf3c18e5608eed2f /ui/app | |
parent | cb7d07ebae142de1712e36b082398f58fba1659a (diff) | |
download | tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.tar tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.tar.gz tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.tar.bz2 tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.tar.lz tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.tar.xz tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.tar.zst tangerine-wallet-browser-e1b9734cbfdf032a21ce75ac8f480f6ba4668bd2.zip |
Move upsize conversions for input warning at front of fn.
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/components/bn-as-decimal-input.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/app/components/bn-as-decimal-input.js b/ui/app/components/bn-as-decimal-input.js index db5af1f46..d3658b202 100644 --- a/ui/app/components/bn-as-decimal-input.js +++ b/ui/app/components/bn-as-decimal-input.js @@ -131,14 +131,16 @@ BnAsDecimalInput.prototype.updateValidity = function (event) { BnAsDecimalInput.prototype.constructWarning = function () { const { name, min, max, scale } = this.props + const newMin = this.downsize(min.toString(10), scale) + const newMax = this.downsize(max.toString(10), scale) let message = name ? name + ' ' : '' if (min && 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)}.` + message += `must be greater than or equal to ${newMin} and less than or equal to ${newMax}.` } else if (min) { - message += `must be greater than or equal to ${this.downsize(min.toString(10), scale)}.` + message += `must be greater than or equal to ${newMin}.` } else if (max) { - message += `must be less than or equal to ${this.downsize(max.toString(10), scale)}.` + message += `must be less than or equal to ${newMax}.` } else { message += 'Invalid input.' } |