mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Move upsize conversions for input warning at front of fn.
This commit is contained in:
parent
cb7d07ebae
commit
e1b9734cbf
@ -131,14 +131,16 @@ BnAsDecimalInput.prototype.updateValidity = function (event) {
|
|||||||
|
|
||||||
BnAsDecimalInput.prototype.constructWarning = function () {
|
BnAsDecimalInput.prototype.constructWarning = function () {
|
||||||
const { name, min, max, scale } = this.props
|
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 + ' ' : ''
|
let message = name ? name + ' ' : ''
|
||||||
|
|
||||||
if (min && max) {
|
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) {
|
} 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) {
|
} 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 {
|
} else {
|
||||||
message += 'Invalid input.'
|
message += 'Invalid input.'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user