1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Move upsize conversions for input warning at front of fn.

This commit is contained in:
Kevin Serrano 2017-10-25 11:35:18 -07:00
parent cb7d07ebae
commit e1b9734cbf
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1

View File

@ -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.'
}