Error getting fee
This commit is contained in:
parent
d48711d3fb
commit
4af0f15380
2 changed files with 15 additions and 3 deletions
|
|
@ -387,7 +387,7 @@
|
||||||
<h4 class="title m0">
|
<h4 class="title m0">
|
||||||
<available-balance></available-balance>
|
<available-balance></available-balance>
|
||||||
<a
|
<a
|
||||||
ng-if="index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount"
|
ng-show="!home.lockedCurrentFeePerKb && index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount"
|
||||||
ng-click="home.sendAll()"
|
ng-click="home.sendAll()"
|
||||||
translate> Send All
|
translate> Send All
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -831,6 +831,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var unitToSat = this.unitToSatoshi;
|
var unitToSat = this.unitToSatoshi;
|
||||||
var currentSpendUnconfirmed = configWallet.spendUnconfirmed;
|
var currentSpendUnconfirmed = configWallet.spendUnconfirmed;
|
||||||
|
var currentFeeLevel = walletSettings.feeLevel || 'normal';
|
||||||
|
|
||||||
if (isCordova && this.isWindowsPhoneApp) {
|
if (isCordova && this.isWindowsPhoneApp) {
|
||||||
this.hideAddress = false;
|
this.hideAddress = false;
|
||||||
|
|
@ -864,7 +865,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
if (self.lockedCurrentFeePerKb) {
|
if (self.lockedCurrentFeePerKb) {
|
||||||
cb(null, self.lockedCurrentFeePerKb);
|
cb(null, self.lockedCurrentFeePerKb);
|
||||||
} else {
|
} else {
|
||||||
feeService.getCurrentFeeValue(self.currentFeeLevel, cb);
|
feeService.getCurrentFeeValue(currentFeeLevel, cb);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1272,16 +1273,27 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
this.sendAll = function() {
|
this.sendAll = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
self.error = null;
|
||||||
|
self.setOngoingProcess(gettext('Getting fee'));
|
||||||
$rootScope.$emit('Local/SetFeeSendMax', function(currentFeePerKb, availableMaxBalance, feeToSendMaxStr) {
|
$rootScope.$emit('Local/SetFeeSendMax', function(currentFeePerKb, availableMaxBalance, feeToSendMaxStr) {
|
||||||
|
self.setOngoingProcess();
|
||||||
|
if (lodash.isNull(currentFeePerKb)) {
|
||||||
|
self.error = gettext('Could not calculate fee');
|
||||||
|
$scope.$apply();
|
||||||
|
return;
|
||||||
|
}
|
||||||
self.lockedCurrentFeePerKb = currentFeePerKb;
|
self.lockedCurrentFeePerKb = currentFeePerKb;
|
||||||
var msg = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees", {
|
var msg = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees", {
|
||||||
fee: feeToSendMaxStr
|
fee: feeToSendMaxStr
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$apply();
|
||||||
confirmDialog.show(msg, function(confirmed) {
|
confirmDialog.show(msg, function(confirmed) {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
self._doSendAll(availableMaxBalance);
|
self._doSendAll(availableMaxBalance);
|
||||||
}
|
} else {
|
||||||
|
self.resetForm();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue