diff options
Diffstat (limited to 'web/react/components/channel_header.jsx')
-rw-r--r-- | web/react/components/channel_header.jsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx index b5eb546cf..3d0246a96 100644 --- a/web/react/components/channel_header.jsx +++ b/web/react/components/channel_header.jsx @@ -51,7 +51,6 @@ export default class ChannelHeader extends React.Component { return { channel: ChannelStore.getCurrent(), memberChannel: ChannelStore.getCurrentMember(), - memberTeam: UserStore.getCurrentUser(), users: extraInfo.members, userCount: extraInfo.member_count, searchVisible: SearchStore.getSearchResults() !== null @@ -61,14 +60,12 @@ export default class ChannelHeader extends React.Component { ChannelStore.addChangeListener(this.onListenerChange); ChannelStore.addExtraInfoChangeListener(this.onListenerChange); SearchStore.addSearchChangeListener(this.onListenerChange); - UserStore.addChangeListener(this.onListenerChange); PreferenceStore.addChangeListener(this.onListenerChange); } componentWillUnmount() { ChannelStore.removeChangeListener(this.onListenerChange); ChannelStore.removeExtraInfoChangeListener(this.onListenerChange); SearchStore.removeSearchChangeListener(this.onListenerChange); - UserStore.removeChangeListener(this.onListenerChange); PreferenceStore.removeChangeListener(this.onListenerChange); } onListenerChange() { @@ -97,11 +94,11 @@ export default class ChannelHeader extends React.Component { searchMentions(e) { e.preventDefault(); - const user = UserStore.getCurrentUser(); + const user = this.props.user; let terms = ''; if (user.notify_props && user.notify_props.mention_keys) { - const termKeys = UserStore.getCurrentMentionKeys(); + const termKeys = UserStore.getMentionKeys(user.id); if (user.notify_props.all === 'true' && termKeys.indexOf('@all') !== -1) { termKeys.splice(termKeys.indexOf('@all'), 1); @@ -150,7 +147,7 @@ export default class ChannelHeader extends React.Component { </Popover> ); let channelTitle = channel.display_name; - const currentId = UserStore.getCurrentId(); + const currentId = this.prop.user.id; const isAdmin = Utils.isAdmin(this.state.memberChannel.roles) || Utils.isAdmin(this.state.memberTeam.roles); const isDirect = (this.state.channel.type === 'D'); @@ -474,3 +471,7 @@ export default class ChannelHeader extends React.Component { ); } } + +ChannelHeader.propTypes = { + user: React.PropTypes.object.isRequired +}; |