diff --git a/app/components/channel_list/channel_list.js b/app/components/channel_list/channel_list.js index 76a124fa5..174ab1873 100644 --- a/app/components/channel_list/channel_list.js +++ b/app/components/channel_list/channel_list.js @@ -115,7 +115,7 @@ class ChannelList extends Component { this.setState({ dataSource: this.state.dataSource.cloneWithRows(this.buildData(nextProps)) }); - const container = this.refs.scrollContainer; + const container = this.scrollContainer; if (container && container._visibleRows && container._visibleRows.s1) { //eslint-disable-line no-underscore-dangle this.updateUnreadIndicators(container._visibleRows); //eslint-disable-line no-underscore-dangle } @@ -167,6 +167,11 @@ class ChannelList extends Component { this.props.actions.markChannelAsRead(channel.id, currentChannel.id); }; + onLayout = (event) => { + const {width} = event.nativeEvent.layout; + this.width = width; + }; + handleClose = (channel) => { this.setState({showOptions: false}); this.props.actions.closeDMChannel(channel); @@ -303,6 +308,7 @@ class ChannelList extends Component { unreadCount = 0; } } + return { mentions, unreadCount @@ -469,7 +475,7 @@ class ChannelList extends Component { if (this.state.showAbove) { above = ( +