Merge pull request #1317 from isocolsky/fix/all_funds

Fixed 'Use all funds' link for amounts below fee
This commit is contained in:
Matias Alejo Garcia 2014-09-09 07:37:15 -03:00
commit f87030c6cb
2 changed files with 9 additions and 1 deletions

View file

@ -400,7 +400,8 @@ angular.module('copayApp.controllers').controller('SendController',
};
$scope.getAvailableAmount = function() {
return ((($rootScope.availableBalance * config.unitToSatoshi).toFixed(0) - bitcore.TransactionBuilder.FEE_PER_1000B_SAT) / config.unitToSatoshi);
var amount = ((($rootScope.availableBalance * config.unitToSatoshi).toFixed(0) - bitcore.TransactionBuilder.FEE_PER_1000B_SAT) / config.unitToSatoshi);
return amount > 0 ? amount : 0;
};
$scope.topAmount = function(form) {