* Moved PostList to take a list of postIds instead of posts * Removed usage of selectors that return posts from ChannelPostList and Thread * Fixed search and switched to use getPostIdsAroundPost selector * Removed use of selectors that returned posts from emoji reactions * Updated makePreparePostIdsForPostList to be better memoized * Fixed filter of join/leave messages * Added unit tests for makePrepaprePostIdsForPostList * Check if post edit/delete should be enabled more often * Updated mattermost-redux version in yarn.lock
33 lines
932 B
JavaScript
33 lines
932 B
JavaScript
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {refreshChannelWithRetry} from 'app/actions/views/channel';
|
|
import {makePreparePostIdsForPostList} from 'app/selectors/post_list';
|
|
|
|
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|
|
|
import PostList from './post_list';
|
|
|
|
function makeMapStateToProps() {
|
|
const preparePostIds = makePreparePostIdsForPostList();
|
|
|
|
return (state, ownProps) => {
|
|
return {
|
|
postIds: preparePostIds(state, ownProps),
|
|
theme: getTheme(state)
|
|
};
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
refreshChannelWithRetry
|
|
}, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(makeMapStateToProps, mapDispatchToProps)(PostList);
|