Fixing js error when redirecting /login for anonymous users
parent
ea7e5ebf49
commit
77b491fd0d
|
@ -1,8 +1,10 @@
|
||||||
WorkingOnDirective = (homeService, currentUserService) ->
|
WorkingOnDirective = (homeService, currentUserService) ->
|
||||||
link = (scope, el, attrs, ctrl) ->
|
link = (scope, el, attrs, ctrl) ->
|
||||||
userId = currentUserService.getUser().get("id")
|
user = currentUserService.getUser()
|
||||||
|
# If we are not logged in the user will be null
|
||||||
ctrl.getWorkInProgress(userId)
|
if user
|
||||||
|
userId = user.get("id")
|
||||||
|
ctrl.getWorkInProgress(userId)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
controller: "WorkingOn",
|
controller: "WorkingOn",
|
||||||
|
|
Loading…
Reference in New Issue