fix interfase and loggin

This commit is contained in:
Matias Alejo Garcia 2014-09-18 19:20:00 -03:00
commit 409cef4d4b
7 changed files with 32 additions and 21 deletions

View file

@ -5,8 +5,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
controllerUtils.redirIfLogged();
$scope.retreiving = true;
walletFactory.getWallets(function(ret) {
walletFactory.getWallets(function(err,ret) {
$scope.retreiving = false;
$scope.hasWallets = (ret && ret.length > 0) ? true : false;
});

View file

@ -16,16 +16,23 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
$scope.loading = false;
$scope.retreiving = true;
walletFactory.getWallets(function(wallets) {
walletFactory.getWallets(function(err, wallets) {
if (!wallets || !wallets.length) {
if (err || !wallets || !wallets.length) {
$location.path('/');
} else {
$scope.retreiving = false;
$scope.wallets = wallets.sort(cmp);
walletFactory.storage.getLastOpened(function(ret) {
if (ret && _.indexOf(_.pluck($scope.wallets, 'id')) == -1)
ret = null;
$scope.selectedWalletId = ret || ($scope.wallets[0] && $scope.wallets[0].id);
$scope.retreiving = false;
setTimeout(function() {
$rootScope.$digest();
}, 0);
});
}
});
@ -49,9 +56,10 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
$scope.loading = false;
notification.error('Error', err.errMsg || 'Wrong password');
$rootScope.$digest();
} else {
$rootScope.updatingBalance = true;
controllerUtils.startNetwork(w, $scope);
}
$rootScope.updatingBalance = true;
controllerUtils.startNetwork(w, $scope);
});
});
};