mirror of https://github.com/BTCPrivate/copay.git
Fix address and amount validation
This commit is contained in:
parent
bb744ef271
commit
594fb8c350
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue