diff options
Diffstat (limited to 'webapp/components/more_direct_channels.jsx')
-rw-r--r-- | webapp/components/more_direct_channels.jsx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/webapp/components/more_direct_channels.jsx b/webapp/components/more_direct_channels.jsx index a83816c40..a7fb2b6cd 100644 --- a/webapp/components/more_direct_channels.jsx +++ b/webapp/components/more_direct_channels.jsx @@ -19,7 +19,6 @@ export default class MoreDirectChannels extends React.Component { this.handleHide = this.handleHide.bind(this); this.handleShowDirectChannel = this.handleShowDirectChannel.bind(this); this.handleUserChange = this.handleUserChange.bind(this); - this.createJoinDirectChannelButton = this.createJoinDirectChannelButton.bind(this); this.state = { @@ -52,6 +51,26 @@ export default class MoreDirectChannels extends React.Component { UserStore.removeChangeListener(this.handleUserChange); } + shouldComponentUpdate(nextProps, nextState) { + if (nextProps.show !== this.props.show) { + return true; + } + + if (nextProps.onModalDismissed.toString() !== this.props.onModalDismissed.toString()) { + return true; + } + + if (nextState.loadingDMChannel !== this.state.loadingDMChannel) { + return true; + } + + if (!Utils.areObjectsEqual(nextState.users, this.state.users)) { + return true; + } + + return false; + } + handleHide() { if (this.props.onModalDismissed) { this.props.onModalDismissed(); |