Set fees in preferences. First step for advanced send

This commit is contained in:
Gustavo Maximiliano Cortez 2015-07-28 10:42:11 -03:00
commit e7a98d44f9
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
10 changed files with 82 additions and 64 deletions

View file

@ -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,

View 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);
});
};
});

View file

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