Make sure to check for user before redirecting in update user
Otherwise, the page redirects before the user is loaded
This commit is contained in:
parent
83e8d62bea
commit
24780eef58
1 changed files with 2 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
$scope.state = 'loading';
|
$scope.state = 'loading';
|
||||||
|
|
||||||
UserService.updateUserIn($scope, function(user) {
|
UserService.updateUserIn($scope, function(user) {
|
||||||
|
if (!user.anonymous) {
|
||||||
if (!user.prompts || !user.prompts.length) {
|
if (!user.prompts || !user.prompts.length) {
|
||||||
$location.path('/');
|
$location.path('/');
|
||||||
return;
|
return;
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
|
|
||||||
$scope.state = 'editing';
|
$scope.state = 'editing';
|
||||||
$scope.username = user.username;
|
$scope.username = user.username;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var confirmUsername = function(username) {
|
var confirmUsername = function(username) {
|
||||||
|
|
Reference in a new issue