Multiple cross-team functionality fixes (#2902)

This commit is contained in:
Joram Wilander
2016-05-06 08:06:34 -04:00
committed by Christopher Speller
parent 4b2843ee9d
commit d75cb02948
7 changed files with 27 additions and 10 deletions

View File

@@ -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