amount input: wrong message when typing some chars

This commit is contained in:
Gustavo Maximiliano Cortez 2014-09-01 15:25:19 -03:00
parent e73a3f8160
commit 21073a5ffe
1 changed files with 2 additions and 1 deletions

View File

@ -45,9 +45,10 @@ angular.module('copayApp.directives')
link: function(scope, element, attrs, ctrl) {
var val = function(value) {
var availableBalanceNum = Number(($rootScope.availableBalance * config.unitToSatoshi).toFixed(0));
var vNum = Number((value * config.unitToSatoshi).toFixed(0)) + feeSat;
var vNum = Number((value * config.unitToSatoshi).toFixed(0));
if (typeof vNum == "number" && vNum > 0) {
vNum = vNum + feeSat;
if (availableBalanceNum < vNum || isNaN(availableBalanceNum)) {
ctrl.$setValidity('enoughAmount', false);
scope.notEnoughAmount = true;