MM-14345: Changes the channelIsReadOnly prop to be associated to the post's channel rather than the current channel. Show the unpin regardless of whether a channel is read-only. (#2656)

This commit is contained in:
Martin Kraft 2019-03-25 20:37:54 -04:00 committed by Miguel Alatzar
parent c3a1e3561e
commit 7423e7d3bf

View file

@ -6,7 +6,7 @@ import {bindActionCreators} from 'redux';
import {createPost, removePost} from 'mattermost-redux/actions/posts';
import {Posts} from 'mattermost-redux/constants';
import {isCurrentChannelReadOnly} from 'mattermost-redux/selectors/entities/channels';
import {isChannelReadOnlyById} from 'mattermost-redux/selectors/entities/channels';
import {getPost, makeGetCommentCountForPost, makeIsPostCommentMention} from 'mattermost-redux/selectors/entities/posts';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {getMyPreferences, getTheme} from 'mattermost-redux/selectors/entities/preferences';
@ -71,7 +71,7 @@ function makeMapStateToProps() {
}
return {
channelIsReadOnly: isCurrentChannelReadOnly(state),
channelIsReadOnly: isChannelReadOnlyById(state, post.channel_id),
currentUserId,
post,
isFirstReply,