summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_view_controller.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/post_view/post_view_controller.jsx')
-rw-r--r--webapp/components/post_view/post_view_controller.jsx21
1 files changed, 5 insertions, 16 deletions
diff --git a/webapp/components/post_view/post_view_controller.jsx b/webapp/components/post_view/post_view_controller.jsx
index 12fd5cd63..57b488b54 100644
--- a/webapp/components/post_view/post_view_controller.jsx
+++ b/webapp/components/post_view/post_view_controller.jsx
@@ -34,13 +34,10 @@ export default class PostViewController extends React.Component {
this.onBusy = this.onBusy.bind(this);
const channel = props.channel;
- let profiles = UserStore.getProfiles();
- if (channel && channel.type === Constants.DM_CHANNEL) {
- profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
- }
+ const profiles = UserStore.getProfiles();
let lastViewed = Number.MAX_VALUE;
- const member = ChannelStore.getMember(channel.id);
+ const member = ChannelStore.getMyMember(channel.id);
if (member != null) {
lastViewed = member.last_viewed_at;
}
@@ -107,12 +104,7 @@ export default class PostViewController extends React.Component {
}
onUserChange() {
- const channel = this.state.channel;
- let profiles = UserStore.getProfiles();
- if (channel && channel.type === Constants.DM_CHANNEL) {
- profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
- }
- this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(profiles))});
+ this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(UserStore.getProfiles()))});
}
onPostsChange() {
@@ -165,15 +157,12 @@ export default class PostViewController extends React.Component {
const channel = nextProps.channel;
let lastViewed = Number.MAX_VALUE;
- const member = ChannelStore.getMember(channel.id);
+ const member = ChannelStore.getMyMember(channel.id);
if (member != null) {
lastViewed = member.last_viewed_at;
}
- let profiles = UserStore.getProfiles();
- if (channel && channel.type === Constants.DM_CHANNEL) {
- profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
- }
+ const profiles = UserStore.getProfiles();
const joinLeaveEnabled = PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'join_leave', true);