Decrease in call to feelevels

This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-19 14:46:52 -05:00
commit 4b1ca3bf5a
3 changed files with 16 additions and 7 deletions

View file

@ -3,7 +3,7 @@
ng-include="'views/includes/topbar.html'" ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Bitcoin Network Fee Policy'; goBackToState = 'preferencesGlobal'; noColor = true"> ng-init="titleSection='Bitcoin Network Fee Policy'; goBackToState = 'preferencesGlobal'; noColor = true">
</div> </div>
<div class="content preferences" ng-controller="preferencesFeeController as prefFee"> <div class="content preferences" ng-controller="preferencesFeeController as prefFee" ng-init="index.setFeesOpts()">
<h4></h4> <h4></h4>
<ul class="no-bullet m0"> <ul class="no-bullet m0">
<li ng-repeat="fee in (index.network == 'livenet' ? index.feeLevels.livenet : index.feeLevels.testnet)" <li ng-repeat="fee in (index.network == 'livenet' ? index.feeLevels.livenet : index.feeLevels.testnet)"

View file

@ -5,13 +5,15 @@
</div> </div>
<div class="content preferences" ng-controller="preferencesHistory as history"> <div class="content preferences" ng-controller="preferencesHistory as history">
<h4></h4> <h4></h4>
<ul class="no-bullet m0" ng-style="{'color':index.backgroundColor}"> <ul class="no-bullet m0">
<li ng-if="!index.isCordova" ng-init="index.csvHistory()"> <li ng-if="!index.isCordova" ng-init="index.csvHistory()">
<a ng-style="{'color':index.backgroundColor}" ng-csv="index.csvContent" csv-header="index.csvHeader" filename="{{ index.csvFilename }}"> <a ng-style="{'color':index.backgroundColor}" ng-csv="index.csvContent"
<span translate>Export to file</span> csv-header="index.csvHeader"
filename="{{index.csvFilename }}" translate>
Export to file
</a> </a>
</li> </li>
<li ng-click="history.clearTransactionHistory();" translate> <li ng-style="{'color':index.backgroundColor}" ng-click="history.clearTransactionHistory();" translate>
Clear cache Clear cache
</li> </li>
</ul> </ul>

View file

@ -358,7 +358,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
} }
$log.debug('Wallet Status:', walletStatus); $log.debug('Wallet Status:', walletStatus);
self.setPendingTxps(walletStatus.pendingTxps); self.setPendingTxps(walletStatus.pendingTxps);
self.setFeesOpts();
if (!self.feeLevels) {
self.setFeesOpts();
}
// Status Shortcuts // Status Shortcuts
self.walletName = walletStatus.wallet.name; self.walletName = walletStatus.wallet.name;
@ -405,6 +408,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (self.availableBalanceSat > feeToSendMaxSat) { if (self.availableBalanceSat > feeToSendMaxSat) {
self.availableMaxBalance = strip((self.availableBalanceSat - feeToSendMaxSat) * self.satToUnit); self.availableMaxBalance = strip((self.availableBalanceSat - feeToSendMaxSat) * self.satToUnit);
self.feeToSendMaxStr = profileService.formatAmount(feeToSendMaxSat) + ' ' + self.unitName; self.feeToSendMaxStr = profileService.formatAmount(feeToSendMaxSat) + ' ' + self.unitName;
} else {
self.feeToSendMaxStr = null;
} }
if (cb) return cb(self.currentFeePerKb, self.availableMaxBalance, self.feeToSendMaxStr); if (cb) return cb(self.currentFeePerKb, self.availableMaxBalance, self.feeToSendMaxStr);
@ -662,7 +667,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.alternativeIsoCode = config.alternativeIsoCode; self.alternativeIsoCode = config.alternativeIsoCode;
// Set fee level and max value to send all // Set fee level and max value to send all
self.setCurrentFeeLevel(); if (!self.currentFeeLevel) {
self.setCurrentFeeLevel();
}
// Check address // Check address
addressService.isUsed(self.walletId, balance.byAddress, function(err, used) { addressService.isUsed(self.walletId, balance.byAddress, function(err, used) {