add support for fee customization
Signed-off-by: Matias Alejo Garcia <ematiu@gmail.com>
This commit is contained in:
parent
7e23bd3406
commit
67ba30a20e
8 changed files with 74 additions and 2 deletions
35
src/js/controllers/preferencesFee.js
Normal file
35
src/js/controllers/preferencesFee.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController',
|
||||
function($rootScope, $scope, configService, go) {
|
||||
var config = configService.getSync();
|
||||
this.feeName = config.wallet.settings.feeName || 'Priority';
|
||||
this.feeOpts = [{
|
||||
name: 'Priority',
|
||||
value: 100,
|
||||
}, {
|
||||
name: 'Normal',
|
||||
value: 50,
|
||||
}, {
|
||||
name: 'Economy',
|
||||
value: 10,
|
||||
}];
|
||||
|
||||
this.save = function(newFee) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
feeName: newFee.name,
|
||||
feeValue: newFee.value * 100,
|
||||
}
|
||||
}
|
||||
};
|
||||
this.feeName = newFee.name;
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) console.log(err);
|
||||
$scope.$emit('Local/UnitSettingUpdated');
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue