Merge pull request #4354 from JDonadio/ref/preferences-fee
Preferences > Fee - Use scope only
This commit is contained in:
commit
c2b9813eda
2 changed files with 28 additions and 35 deletions
|
|
@ -1,36 +1,29 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController',
|
||||
function($scope, $rootScope, configService, feeService) {
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController', function($scope, configService, feeService) {
|
||||
|
||||
this.init = function() {
|
||||
var self = this;
|
||||
this.loading = true;
|
||||
feeService.getFeeLevels(function(levels) {
|
||||
self.loading = false;
|
||||
self.feeOpts = feeService.feeOpts;
|
||||
$scope.data = {
|
||||
currentFeeLevel: feeService.getCurrentFeeLevel()
|
||||
};
|
||||
self.feeLevels = levels;
|
||||
$scope.$apply();
|
||||
});
|
||||
};
|
||||
$scope.loading = true;
|
||||
|
||||
this.save = function(newFee) {
|
||||
var self = this;
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
feeLevel: newFee.level
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
$scope.currentFeeLevel = newFee.level;
|
||||
});
|
||||
|
||||
};
|
||||
feeService.getFeeLevels(function(levels) {
|
||||
$scope.loading = false;
|
||||
$scope.feeOpts = feeService.feeOpts;
|
||||
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
|
||||
$scope.feeLevels = levels;
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
$scope.save = function(newFee) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
feeLevel: newFee.level
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
$scope.currentFeeLevel = newFee.level;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue