Fixed a bug with the profile view caused by the new page loading system.

This commit is contained in:
Scott Erickson 2014-04-04 13:59:40 -07:00
parent 1971ddcefb
commit 2093049f5c
2 changed files with 6 additions and 6 deletions

View file

@ -16,7 +16,7 @@ block content
else
span(data-i18n="account_profile.profile") Profile
if loading
if loadingProfile
p(data-i18n="common.loading") Loading...
else if !user.get('emailHash')

View file

@ -5,21 +5,21 @@ User = require 'models/User'
module.exports = class ProfileView extends View
id: "profile-view"
template: template
loading: true
loadingProfile: true
constructor: (options, @userID) ->
super options
@user = User.getByID(@userID)
@loading = false if 'gravatarProfile' of @user
@loadingProfile = false if 'gravatarProfile' of @user
@listenTo(@user, 'change', @userChanged)
@listenTo(@user, 'error', @userError)
userChanged: (user) ->
@loading = false if 'gravatarProfile' of user
@loadingProfile = false if 'gravatarProfile' of user
@render()
userError: (user) ->
@loading = false
@loadingProfile = false
@render()
getRenderData: ->
@ -28,7 +28,7 @@ module.exports = class ProfileView extends View
grav = grav.entry[0] if grav
addedContext =
user: @user
loading: @loading
loadingProfile: @loadingProfile
myProfile: @user.id is context.me.id
grav: grav
photoURL: @user.getPhotoURL()