Ref get/set fee level
This commit is contained in:
parent
4b1ca3bf5a
commit
4829b40250
11 changed files with 81 additions and 101 deletions
|
|
@ -1,9 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController',
|
||||
function($rootScope, configService) {
|
||||
function($scope, $rootScope, configService, feeService) {
|
||||
|
||||
this.init = function() {
|
||||
var self = this;
|
||||
this.loading = true;
|
||||
feeService.getFeeLevels(function(levels) {
|
||||
self.loading = false;
|
||||
self.feeOpts = feeService.feeOpts;
|
||||
self.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||
self.feeLevels = levels;
|
||||
$scope.$apply();
|
||||
});
|
||||
};
|
||||
|
||||
this.save = function(newFee) {
|
||||
var self = this;
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
|
|
@ -11,10 +24,10 @@ angular.module('copayApp.controllers').controller('preferencesFeeController',
|
|||
}
|
||||
}
|
||||
};
|
||||
$rootScope.$emit('Local/FeeLevelUpdated', newFee);
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
self.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||
});
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue