login working on the UX
This commit is contained in:
parent
7a2906c8d1
commit
92f1bacf82
10 changed files with 125 additions and 72 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue