Do not close permalink view when post is deleted (#1987)

This commit is contained in:
Elias Nahum 2018-08-09 08:29:57 -04:00 committed by GitHub
parent 95ec582849
commit 80d206baf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View file

@ -6,7 +6,6 @@ import {connect} from 'react-redux';
import {getChannel as getChannelAction, joinChannel, markChannelAsRead, markChannelAsViewed} from 'mattermost-redux/actions/channels';
import {getPostsAfter, getPostsBefore, getPostThread, selectPost} from 'mattermost-redux/actions/posts';
import {Posts} from 'mattermost-redux/constants';
import {makeGetChannel, getMyChannelMemberships} from 'mattermost-redux/selectors/entities/channels';
import {makeGetPostIdsAroundPost, getPost} from 'mattermost-redux/selectors/entities/posts';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
@ -34,7 +33,7 @@ function makeMapStateToProps() {
let channel;
let postIds;
if (post && post.delete_at === 0 && post.state !== Posts.POST_DELETED) {
if (post) {
channel = getChannel(state, {id: post.channel_id});
postIds = getPostIdsAroundPost(state, currentFocusedPostId, post.channel_id, {
postsBeforeCount: 10,

View file

@ -114,10 +114,6 @@ export default class Permalink extends PureComponent {
}
componentWillReceiveProps(nextProps) {
if (nextProps.channelId === '' && this.mounted) {
this.handleClose();
}
if (this.props.channelName !== nextProps.channelName && this.mounted) {
this.setState({title: nextProps.channelName});
}