login working on the UX

This commit is contained in:
Matias Alejo Garcia 2014-10-01 08:35:17 -03:00
commit 92f1bacf82
10 changed files with 125 additions and 72 deletions

View file

@ -1,12 +1,28 @@
'use strict';
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils) {
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager) {
controllerUtils.redirIfLogged();
//$scope.retreiving = true;
// identity.getWallets(function(err,ret) {
// $scope.retreiving = false;
// $scope.hasWallets = (ret && ret.length > 0) ? true : false;
// });
$scope.openProfile = function(form) {
$scope.loading = true;
copay.Identity.open(form.email.$modelValue, form.password.$modelValue, {
pluginManager: pluginManager,
network: config.network,
networkName: config.networkName,
walletDefaults: config.wallet,
passphrase: config.passphrase,
}, function(err, iden, w) {
if (err && !w) {
console.log('Error:' + err)
controllerUtils.onErrorDigest(
$scope, (err.toString()||'').match('PNOTFOUND') ? 'Profile not found' : 'Unknown error');
} else {
$scope.loading = false;
$rootScope.iden = iden;
$rootScope.wallet = w;
controllerUtils.bindWallet(w, $scope);
}
});
}
});