diff --git a/app/views/kinds/UserView.coffee b/app/views/kinds/UserView.coffee index d73e9cc7f..27100b82b 100644 --- a/app/views/kinds/UserView.coffee +++ b/app/views/kinds/UserView.coffee @@ -25,13 +25,14 @@ module.exports = class UserView extends RootView context.user = @user unless @user?.isAnonymous() context - isMe: -> @userID is me.id + isMe: -> @userID in [me.id, me.get('slug')] onLoaded: -> @onUserLoaded @user if @user.loaded and not @userLoaded super() onUserLoaded: -> + @userID = @user.id @userLoaded = true ifUserNotFound: -> diff --git a/app/views/user/JobProfileView.coffee b/app/views/user/JobProfileView.coffee index c910522fd..fe0ba9024 100644 --- a/app/views/user/JobProfileView.coffee +++ b/app/views/user/JobProfileView.coffee @@ -84,7 +84,7 @@ module.exports = class JobProfileView extends UserView if me.isAdmin() or 'employer' in me.get('permissions', true) $.post "/db/user/#{me.id}/track/view_candidate" $.post "/db/user/#{@userID}/track/viewed_by_employer" unless me.isAdmin() - @sessions = @supermodel.loadCollection(new LevelSessionsCollection(@userID), 'candidate_sessions').model + @sessions = @supermodel.loadCollection(new LevelSessionsCollection(@user.id), 'candidate_sessions').model @listenToOnce @sessions, 'sync', => @render?() if me.isAdmin() # Mimicking how the VictoryModal fetches LevelFeedback