mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fixed a bug with the profile view caused by the new page loading system.
This commit is contained in:
parent
1971ddcefb
commit
2093049f5c
2 changed files with 6 additions and 6 deletions
|
@ -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')
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue