diff --git a/app/components/channel_drawer_list/channel_drawer_list.js b/app/components/channel_drawer_list/channel_drawer_list.js index c035f913c..dd7b69cd0 100644 --- a/app/components/channel_drawer_list/channel_drawer_list.js +++ b/app/components/channel_drawer_list/channel_drawer_list.js @@ -49,10 +49,8 @@ class ChannelDrawerList extends Component { constructor(props) { super(props); this.firstUnreadChannel = null; - this.lastUnreadChannel = null; this.state = { showAbove: false, - showBelow: false, dataSource: this.buildData(props) }; MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor). @@ -80,13 +78,11 @@ class ChannelDrawerList extends Component { updateUnreadIndicators = ({viewableItems}) => { let showAbove = false; - let showBelow = false; const visibleIndexes = viewableItems.map((v) => v.index); if (visibleIndexes.length) { const {dataSource} = this.state; const firstVisible = parseInt(visibleIndexes[0], 10); - const lastVisible = parseInt(visibleIndexes[visibleIndexes.length - 1], 10); if (this.firstUnreadChannel) { const index = dataSource.findIndex((item) => { @@ -95,16 +91,8 @@ class ChannelDrawerList extends Component { showAbove = index < firstVisible; } - if (this.lastUnreadChannel) { - const index = dataSource.findIndex((item) => { - return item.display_name === this.lastUnreadChannel; - }); - showBelow = index > lastVisible; - } - this.setState({ - showAbove, - showBelow + showAbove }); } }; @@ -147,7 +135,6 @@ class ChannelDrawerList extends Component { if (!this.firstUnreadChannel) { this.firstUnreadChannel = c.display_name; } - this.lastUnreadChannel = c.display_name; } } }); @@ -245,7 +232,6 @@ class ChannelDrawerList extends Component { ); this.firstUnreadChannel = null; - this.lastUnreadChannel = null; this.findUnreadChannels(data); return data; @@ -382,7 +368,7 @@ class ChannelDrawerList extends Component { theme } = this.props; - const {dataSource, showAbove, showBelow} = this.state; + const {dataSource, showAbove} = this.state; const teamMembers = Object.values(myTeamMembers); if (!currentChannel) { @@ -420,22 +406,6 @@ class ChannelDrawerList extends Component { ); } - let below; - if (showBelow) { - below = ( - - )} - /> - ); - } - const title = ( {above} - {below} ); } @@ -658,10 +627,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { backgroundColor: theme.mentionBj, top: 79 }, - below: { - backgroundColor: theme.mentionBj, - bottom: 15 - }, indicatorText: { backgroundColor: 'transparent', color: theme.mentionColor,