settings: refactor views

This commit is contained in:
Manuel Araoz 2014-09-03 11:27:31 -03:00
commit e992b976e0
4 changed files with 63 additions and 73 deletions

View file

@ -4,8 +4,8 @@ angular.module('copayApp.controllers').controller('MoreController',
function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils, notification) {
var w = $rootScope.wallet;
$scope.hideAdv=true;
$scope.hidePriv=true;
$scope.hideAdv = true;
$scope.hidePriv = true;
if (w)
$scope.priv = w.privateKey.toObj().extendedPrivateKeyString;
@ -24,7 +24,7 @@ angular.module('copayApp.controllers').controller('MoreController',
$scope.purge = function(deleteAll) {
var w = $rootScope.wallet;
var removed = w.purgeTxProposals(deleteAll);
if (removed){
if (removed) {
controllerUtils.updateBalance();
}
notification.info('Tx Proposals Purged', removed + ' transaction proposal purged');
@ -32,14 +32,14 @@ angular.module('copayApp.controllers').controller('MoreController',
$scope.updateIndexes = function() {
var w = $rootScope.wallet;
notification.info('Scaning for transactions','Using derived addresses from your wallet');
notification.info('Scaning for transactions', 'Using derived addresses from your wallet');
w.updateIndexes(function(err) {
notification.info('Scan Ended', 'Updating balance');
if (err) {
notification.error('Error', 'Error updating indexes: ' + err);
}
controllerUtils.updateAddressList();
controllerUtils.updateBalance(function(){
controllerUtils.updateBalance(function() {
notification.info('Finished', 'The balance is updated using the derived addresses');
w.sendIndexes();
});

View file

@ -4,11 +4,9 @@ angular.module('copayApp.controllers').controller('SettingsController', function
controllerUtils.redirIfLogged();
$scope.title = 'Settings';
$scope.networkName = config.networkName;
$scope.insightHost = config.blockchain.host;
$scope.insightPort = config.blockchain.port;
$scope.insightSecure = config.blockchain.schema === 'https';
$scope.forceNetwork = config.forceNetwork;
$scope.defaultLanguage = config.defaultLanguage || 'en';
$scope.availableLanguages = [{