Ref get/set fee level

This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-22 19:56:53 -03:00
commit 4829b40250
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
11 changed files with 81 additions and 101 deletions

View file

@ -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();
});
};