send all button appear

This commit is contained in:
Javier 2015-09-25 13:39:41 -03:00
parent 6cb373f961
commit 5d2f6782e2
2 changed files with 12 additions and 14 deletions

View File

@ -333,19 +333,20 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.setSendMax = function() {
self.feeToSendMaxStr = null;
self.feeRateToSendMax = null;
// Set Send max
if (self.currentFeeLevel && self.totalBytesToSendMax) {
feeService.getCurrentFeeValue(self.currentFeeLevel, function(err, feePerKb) {
// KB to send max
if (self.totalBytesToSendMax) {
var feeToSendMaxSat = parseInt(((self.totalBytesToSendMax * feePerKb) / 1000.).toFixed(0));
self.feeRateToSendMax = feePerKb;
var feeToSendMaxSat = parseInt(((self.totalBytesToSendMax * feePerKb) / 1000.).toFixed(0));
self.feeRateToSendMax = feePerKb;
if (self.availableBalanceSat > feeToSendMaxSat) {
self.availableMaxBalance = strip((self.availableBalanceSat - feeToSendMaxSat) * self.satToUnit);
self.feeToSendMaxStr = profileService.formatAmount(feeToSendMaxSat) + ' ' + self.unitName;
} else {
self.feeToSendMaxStr = null;
self.feeRateToSendMax = null;
}
});
}
@ -1255,4 +1256,4 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.setFocusedWallet();
});
});
});
});

View File

@ -1315,13 +1315,10 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
fee: feeStr
});
if (amount - parseInt(feeStr) > 0) {
confirmDialog.show(msg, function(confirmed) {
if (confirmed)
self._doSendAll(amount, feeRate);
});
} else
$rootScope.$emit('Local/ShowAlert', gettextCatalog.getString('Not enough funds for network fees'));
confirmDialog.show(msg, function(confirmed) {
if (confirmed)
self._doSendAll(amount, feeRate);
});
};
/* Start setup */