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:
Joseph Schorr 2016-11-08 19:15:11 -05:00
parent 83e8d62bea
commit 24780eef58

View file

@ -12,6 +12,7 @@
$scope.state = 'loading';
UserService.updateUserIn($scope, function(user) {
if (!user.anonymous) {
if (!user.prompts || !user.prompts.length) {
$location.path('/');
return;
@ -19,6 +20,7 @@
$scope.state = 'editing';
$scope.username = user.username;
}
});
var confirmUsername = function(username) {