Moves Glidera link to sidebar

This commit is contained in:
Gustavo Maximiliano Cortez 2015-09-11 13:11:41 -03:00
commit 67e2cb1d6c
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
13 changed files with 263 additions and 62 deletions

View file

@ -10,6 +10,8 @@ angular.module('copayApp.controllers').controller('preferencesController',
isoCode: config.wallet.settings.alternativeIsoCode
};
$scope.spendUnconfirmed = config.wallet.spendUnconfirmed;
$scope.glideraEnabled = config.glidera.enabled;
$scope.glideraTestnet = config.glidera.testnet;
var fc = profileService.focusedClient;
if (fc)
$scope.encrypt = fc.hasPrivKeyEncrypted();
@ -61,8 +63,36 @@ angular.module('copayApp.controllers').controller('preferencesController',
}
});
var unwatchGlideraEnabled = $scope.$watch('glideraEnabled', function(newVal, oldVal) {
if (newVal == oldVal) return;
var opts = {
glidera: {
enabled: newVal
}
};
configService.set(opts, function(err) {
$rootScope.$emit('Local/GlideraUpdated');
if (err) $log.debug(err);
});
});
var unwatchGlideraTestnet = $scope.$watch('glideraTestnet', function(newVal, oldVal) {
if (newVal == oldVal) return;
var opts = {
glidera: {
testnet: newVal
}
};
configService.set(opts, function(err) {
$rootScope.$emit('Local/GlideraUpdated');
if (err) $log.debug(err);
});
});
$scope.$on('$destroy', function() {
unwatch();
unwatchSpendUnconfirmed();
unwatchGlideraEnabled();
unwatchGlideraTestnet();
});
});