diff --git a/app/screens/channel/channel_post_list/channel_post_list.js b/app/screens/channel/channel_post_list/channel_post_list.js index 4e38d5346..4ba4e6bbf 100644 --- a/app/screens/channel/channel_post_list/channel_post_list.js +++ b/app/screens/channel/channel_post_list/channel_post_list.js @@ -3,7 +3,6 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {injectIntl, intlShape} from 'react-intl'; import { Platform, StyleSheet, @@ -15,7 +14,7 @@ import PostListRetry from 'app/components/post_list_retry'; import RetryBarIndicator from 'app/components/retry_bar_indicator'; import tracker from 'app/utils/time_tracker'; -class ChannelPostList extends PureComponent { +export default class ChannelPostList extends PureComponent { static propTypes = { actions: PropTypes.shape({ loadPostsIfNecessaryWithRetry: PropTypes.func.isRequired, @@ -28,12 +27,10 @@ class ChannelPostList extends PureComponent { channelId: PropTypes.string.isRequired, channelRefreshingFailed: PropTypes.bool, currentUserId: PropTypes.string, - intl: intlShape.isRequired, lastViewedAt: PropTypes.number, navigator: PropTypes.object, postIds: PropTypes.array.isRequired, postVisibility: PropTypes.number, - totalMessageCount: PropTypes.number, theme: PropTypes.object.isRequired }; @@ -175,5 +172,3 @@ const style = StyleSheet.create({ flex: 1 } }); - -export default injectIntl(ChannelPostList); diff --git a/app/screens/channel/channel_post_list/index.js b/app/screens/channel/channel_post_list/index.js index b4c2c7e94..f76eb3465 100644 --- a/app/screens/channel/channel_post_list/index.js +++ b/app/screens/channel/channel_post_list/index.js @@ -6,7 +6,7 @@ import {connect} from 'react-redux'; import {selectPost} from 'mattermost-redux/actions/posts'; import {getPostIdsInCurrentChannel} from 'mattermost-redux/selectors/entities/posts'; -import {getCurrentChannelId, getMyCurrentChannelMembership, makeGetChannel} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentChannelId, getMyCurrentChannelMembership} from 'mattermost-redux/selectors/entities/channels'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; @@ -15,24 +15,18 @@ import {recordLoadTime} from 'app/actions/views/root'; import ChannelPostList from './channel_post_list'; -function makeMapStateToProps() { - const getChannel = makeGetChannel(); +function mapStateToProps(state) { + const channelId = getCurrentChannelId(state); + const channelRefreshingFailed = state.views.channel.retryFailed; - return function mapStateToProps(state) { - const channelId = getCurrentChannelId(state); - const channelRefreshingFailed = state.views.channel.retryFailed; - const channel = getChannel(state, {id: channelId}) || {}; - - return { - channelId, - channelRefreshingFailed, - currentUserId: getCurrentUserId(state), - postIds: getPostIdsInCurrentChannel(state), - postVisibility: state.views.channel.postVisibility[channelId], - lastViewedAt: getMyCurrentChannelMembership(state).last_viewed_at, - totalMessageCount: channel.total_msg_count, - theme: getTheme(state) - }; + return { + channelId, + channelRefreshingFailed, + currentUserId: getCurrentUserId(state), + postIds: getPostIdsInCurrentChannel(state), + postVisibility: state.views.channel.postVisibility[channelId], + lastViewedAt: getMyCurrentChannelMembership(state).last_viewed_at, + theme: getTheme(state) }; } @@ -49,4 +43,4 @@ function mapDispatchToProps(dispatch) { }; } -export default connect(makeMapStateToProps, mapDispatchToProps)(ChannelPostList); +export default connect(mapStateToProps, mapDispatchToProps)(ChannelPostList);