summaryrefslogtreecommitdiffstats
path: root/webapp/components/posts_view.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-06 08:06:34 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-06 08:06:34 -0400
commitd75cb0294896e0e45f280cbccde8581376d501ce (patch)
tree0d82a1d959945aa2a2e73633233d9c681212f209 /webapp/components/posts_view.jsx
parent4b2843ee9d513a6b464e1e581e9cee8baaaa4317 (diff)
downloadchat-d75cb0294896e0e45f280cbccde8581376d501ce.tar.gz
chat-d75cb0294896e0e45f280cbccde8581376d501ce.tar.bz2
chat-d75cb0294896e0e45f280cbccde8581376d501ce.zip
Multiple cross-team functionality fixes (#2902)
Diffstat (limited to 'webapp/components/posts_view.jsx')
-rw-r--r--webapp/components/posts_view.jsx13
1 files changed, 11 insertions, 2 deletions
diff --git a/webapp/components/posts_view.jsx b/webapp/components/posts_view.jsx
index 3cc0c1a92..4a81feba2 100644
--- a/webapp/components/posts_view.jsx
+++ b/webapp/components/posts_view.jsx
@@ -47,13 +47,18 @@ export default class PostsView extends React.Component {
this.scrollStopAction = new DelayedAction(this.handleScrollStop);
+ let profiles = UserStore.getProfiles();
+ if (props.channel.type === Constants.DM_CHANNEL) {
+ profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
+ }
+
this.state = {
displayNameType: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'name_format', 'false'),
centerPosts: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.CHANNEL_DISPLAY_MODE, Preferences.CHANNEL_DISPLAY_MODE_DEFAULT) === Preferences.CHANNEL_DISPLAY_MODE_CENTERED,
isScrolling: false,
topPostId: null,
currentUser: UserStore.getCurrentUser(),
- profiles: UserStore.getProfiles()
+ profiles
};
}
static get SCROLL_TYPE_FREE() {
@@ -78,7 +83,11 @@ export default class PostsView extends React.Component {
});
}
onUserChange() {
- this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(UserStore.getProfiles()))});
+ let profiles = UserStore.getProfiles();
+ if (this.props.channel.type === Constants.DM_CHANNEL) {
+ profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
+ }
+ this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(profiles))});
}
isAtBottom() {
// consider the view to be at the bottom if it's within this many pixels of the bottom