Fix address and amount validation

This commit is contained in:
Yemel Jardi 2014-08-15 23:00:12 -03:00
parent bb744ef271
commit 594fb8c350
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ angular.module('copayApp.controllers').controller('SendController',
if ($rootScope.pendingPayment) {
var pp = $rootScope.pendingPayment;
$scope.address = pp.address;
$scope.address = pp.address + '';
var amount = pp.data.amount / config.unitToSatoshi * 100000000;
$scope.amount = amount;
$scope.commentText = pp.data.message;

View File

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