diff --git a/app/components/channel_drawer/index.js b/app/components/channel_drawer/index.js index 7259e6968..17b153ef4 100644 --- a/app/components/channel_drawer/index.js +++ b/app/components/channel_drawer/index.js @@ -6,7 +6,7 @@ import {connect} from 'react-redux'; import {handleSelectChannel, setChannelLoading} from 'app/actions/views/channel'; -import {getChannelsByCategory, getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; +import {getChannelsWithUnreadSection, getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; import {getTheme} from 'app/selectors/preferences'; import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; @@ -19,7 +19,7 @@ function mapStateToProps(state, ownProps) { ...ownProps, currentTeam: getCurrentTeam(state), currentChannel: getCurrentChannel(state), - channels: getChannelsByCategory(state), + channels: getChannelsWithUnreadSection(state), channelMembers: state.entities.channels.myMembers, theme: getTheme(state) }; diff --git a/app/components/channel_drawer_list/channel_drawer_list.js b/app/components/channel_drawer_list/channel_drawer_list.js index ec21352a8..008649c58 100644 --- a/app/components/channel_drawer_list/channel_drawer_list.js +++ b/app/components/channel_drawer_list/channel_drawer_list.js @@ -201,12 +201,20 @@ class ChannelDrawerList extends Component { const styles = getStyleSheet(theme); const { + unreadChannels, favoriteChannels, publicChannels, privateChannels, directAndGroupChannels } = props.channels; + if (unreadChannels.length) { + data.push( + this.renderTitle(styles, 'mobile.channel_list.unreads', 'UNREADS', null, unreadChannels.length > 0), + ...unreadChannels + ); + } + if (favoriteChannels.length) { data.push( this.renderTitle(styles, 'sidebar.favorite', 'FAVORITES', null, favoriteChannels.length > 0), diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index 7d8e37c09..4eff089e8 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -1695,6 +1695,7 @@ "mobile.channel_list.openGM": "Open Group Message", "mobile.channel_list.privateChannel": "Private Channel", "mobile.channel_list.publicChannel": "Public Channel", + "mobile.channel_list.unreads": "UNREADS", "mobile.components.channels_list_view.yourChannels": "Your channels:", "mobile.components.error_list.dismiss_all": "Dismiss All", "mobile.components.select_server_view.continue": "Continue", diff --git a/yarn.lock b/yarn.lock index 1354b2f17..1058a0f48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3562,7 +3562,7 @@ makeerror@1.0.x: mattermost-redux@mattermost/mattermost-redux#master: version "0.0.1" - resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/17b85854e5fda76d4e91b1e28d1e26b4ad57394d" + resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/dd0d59b2b29aea9c9e6407b72c8eb6e6e0ba091f" dependencies: deep-equal "1.0.1" harmony-reflect "1.5.1"