Wallet/js/controllers/home.js

28 lines
943 B
JavaScript
Raw Normal View History

'use strict';
2014-10-01 08:35:17 -03:00
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager) {
2014-08-04 11:27:46 -03:00
2014-09-03 01:25:08 -03:00
controllerUtils.redirIfLogged();
2014-10-01 08:35:17 -03:00
$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);
}
});
}
2014-09-03 01:25:08 -03:00
});