Advanced send options

This commit is contained in:
Gustavo Maximiliano Cortez 2015-08-03 20:39:09 -03:00
commit 779db5a06c
6 changed files with 73 additions and 33 deletions

View file

@ -9,10 +9,25 @@ angular.module('copayApp.controllers').controller('preferencesController',
name: config.wallet.settings.alternativeName,
isoCode: config.wallet.settings.alternativeIsoCode
};
$scope.spendUnconfirmed = config.wallet.spendUnconfirmed;
var fc = profileService.focusedClient;
if (fc)
$scope.encrypt = fc.hasPrivKeyEncrypted();
var unwatchSpendUnconfirmed = $scope.$watch('spendUnconfirmed', function(newVal, oldVal) {
if (newVal == oldVal) return;
var opts = {
wallet: {
spendUnconfirmed: newVal
}
};
$rootScope.$emit('Local/SpendUnconfirmedUpdated');
configService.set(opts, function(err) {
if (err) $log.debug(err);
});
});
var unwatch = $scope.$watch('encrypt', function(val) {
var fc = profileService.focusedClient;
if (!fc) return;
@ -49,5 +64,6 @@ angular.module('copayApp.controllers').controller('preferencesController',
$scope.$on('$destroy', function() {
unwatch();
unwatchSpendUnconfirmed();
});
});