mirror of https://github.com/BTCPrivate/copay.git
send all button appear
This commit is contained in:
parent
6cb373f961
commit
5d2f6782e2
|
@ -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;
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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'));
|
||||
};
|
||||
|
||||
/* Start setup */
|
||||
|
|
Loading…
Reference in New Issue