Merge pull request #1598 from cmgustavo/feature/identity-compat01

Display a message for users whose have wallet:: but not profile::
This commit is contained in:
Matias Alejo Garcia 2014-10-30 10:00:32 -03:00
commit 02ab30610f
7 changed files with 94 additions and 8 deletions

View file

@ -4,6 +4,24 @@ angular.module('copayApp.services')
.factory('identityService', function($rootScope, $location, pluginManager, controllerUtils) {
var root = {};
root.check = function (scope) {
copay.Identity.checkIfExistsAny({
pluginManager: pluginManager,
}, function(anyProfile) {
copay.Wallet.checkIfExistsAny({
pluginManager: pluginManager,
}, function(anyWallet) {
scope.retreiving = false;
scope.anyProfile = anyProfile ? true : false;
scope.anyWallet = anyWallet ? true : false;
if (!scope.anyProfile) {
$location.path('/createProfile');
}
});
});
};
root.create = function(scope, form) {
var iden = copay.Identity.create({
email: form.email.$modelValue,
@ -60,7 +78,7 @@ angular.module('copayApp.services')
}
scope.loading = false;
});
}
};
return root;
});