wBanano / wban-dApp

GNU General Public License v3.0
20 stars 11 forks source link

Can't make withdrawals/swaps with decimals and less than 1 (w)BAN #1

Closed wrap-that-potassium closed 3 years ago

wrap-that-potassium commented 3 years ago

The form does not allow to withdraw 0.6 BAN for example: image

wrap-that-potassium commented 3 years ago

Bug in form validation rules.

validationRules: Array<Function> = [
  (val: string) => val == '' || Number.parseInt(val) > 0 || 'Amount should be more than zero',
  (val: string) => this.isLowerThanMax(val) || `Not enough ${this.currency} available!`
]

parseInt should parseFloat instead!

wrap-that-potassium commented 3 years ago

Still does not work with swaps amount like "0.12". The validation rule is okay but the the "Swap" button is still disabled.