From 83d34dcc6c5964ed4dfc4759fe4c9683606ab7fa Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 12 Nov 2015 12:13:26 -0500 Subject: Fix profile loading in RHS on refresh --- web/react/components/user_profile.jsx | 2 +- web/react/stores/user_store.jsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'web/react') diff --git a/web/react/components/user_profile.jsx b/web/react/components/user_profile.jsx index eb0a8f0ca..0572a55f6 100644 --- a/web/react/components/user_profile.jsx +++ b/web/react/components/user_profile.jsx @@ -29,7 +29,7 @@ export default class UserProfile extends React.Component { return {profile: {id: '0', username: '...'}}; } - return {profile: profile}; + return {profile}; } componentDidMount() { UserStore.addChangeListener(this.onChange); diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index 6b7d671fc..e0ecc37aa 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -164,6 +164,10 @@ class UserStoreClass extends EventEmitter { } getProfile(userId) { + if (userId === this.getCurrentId()) { + return this.getCurrentUser(); + } + return this.getProfiles()[userId]; } -- cgit v1.2.3-1-g7c22