Set fees in preferences. First step for advanced send
This commit is contained in:
parent
075206cd8f
commit
e7a98d44f9
10 changed files with 82 additions and 64 deletions
|
|
@ -4,7 +4,6 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
function($scope, $rootScope, $filter, $timeout, $modal, $log, lodash, configService, profileService) {
|
||||
var config = configService.getSync();
|
||||
this.unitName = config.wallet.settings.unitName;
|
||||
this.feeName = config.wallet.settings.feeName || 'Priority';
|
||||
this.bwsurl = config.bws.url;
|
||||
this.selectedAlternative = {
|
||||
name: config.wallet.settings.alternativeName,
|
||||
|
|
|
|||
21
src/js/controllers/preferencesFee.js
Normal file
21
src/js/controllers/preferencesFee.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController',
|
||||
function($rootScope, configService) {
|
||||
|
||||
this.save = function(newFee) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
feeLevel: newFee
|
||||
}
|
||||
}
|
||||
};
|
||||
$rootScope.$emit('Local/FeeLevelUpdated', newFee);
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
|
|
@ -973,7 +973,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
}
|
||||
};
|
||||
|
||||
this.openFeeLevelsModal = function(feeLevels, currentFeeLevel) {
|
||||
// Advanced SEND: set temporary fee policy for each transaction
|
||||
this.openAdvancedSendModal = function(feeLevels, currentFeeLevel) {
|
||||
var fc = profileService.focusedClient;
|
||||
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
|
|
@ -981,21 +982,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
$scope.currentFeeLevel = currentFeeLevel
|
||||
$scope.network = fc.credentials.network;
|
||||
$scope.color = fc.backgroundColor;
|
||||
|
||||
$scope.save = function(level) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
feeLevel: level
|
||||
}
|
||||
}
|
||||
};
|
||||
$scope.currentFeeLevel = level;
|
||||
$rootScope.$emit('Local/FeeLevelUpdated', level);
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.debug(err);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
|
|
@ -1003,7 +991,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
};
|
||||
};
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'views/modals/fee.html',
|
||||
templateUrl: 'views/modals/advancedSend.html',
|
||||
windowClass: 'full animated slideInUp',
|
||||
controller: ModalInstanceCtrl
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue