Adds three levels of dynamic fees
This commit is contained in:
parent
49c606f135
commit
5742dee340
10 changed files with 241 additions and 110 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, rateService, storageService, addressService, gettextCatalog, gettext, amMoment, nodeWebkit, addonManager) {
|
||||
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, rateService, storageService, addressService, gettextCatalog, gettext, amMoment, nodeWebkit, addonManager, feeService) {
|
||||
var self = this;
|
||||
self.isCordova = isCordova;
|
||||
self.onGoingProcess = {};
|
||||
|
|
@ -278,6 +278,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
}
|
||||
$log.debug('Wallet Status:', walletStatus);
|
||||
self.setPendingTxps(walletStatus.pendingTxps);
|
||||
self.setFees();
|
||||
|
||||
// Status Shortcuts
|
||||
self.walletName = walletStatus.wallet.name;
|
||||
|
|
@ -305,6 +306,22 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
self.setCurrentFeeLevel = function(level) {
|
||||
self.currentFeeLevel = level || configService.getSync().wallet.settings.feeLevel || 'priority';
|
||||
};
|
||||
|
||||
self.setFees = function() {
|
||||
var fc = profileService.focusedClient;
|
||||
if (!fc) return;
|
||||
$timeout(function() {
|
||||
feeService.getFeeLevels(function(levels) {
|
||||
self.feeLevels = levels;
|
||||
self.setCurrentFeeLevel();
|
||||
$rootScope.$apply();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
self.updateBalance = function() {
|
||||
var fc = profileService.focusedClient;
|
||||
$timeout(function() {
|
||||
|
|
@ -801,6 +818,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/FeeLevelUpdated', function(event, level) {
|
||||
self.setCurrentFeeLevel(level);
|
||||
});
|
||||
|
||||
$rootScope.$on('Local/ProfileBound', function() {
|
||||
storageService.getRemotePrefsStoredFlag(function(err, val) {
|
||||
if (err || val) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue