Commit 8b140211 authored by Jesús Espino's avatar Jesús Espino Committed by Martin Kraft
Browse files

MM-12839: Remove archived channels posts from search results when needed (#2066)

parent e729b7b8
......@@ -706,7 +706,7 @@ function handleChannelDeletedEvent(msg) {
browserHistory.push(teamUrl + '/channels/' + Constants.DEFAULT_CHANNEL);
}
dispatch({type: ChannelTypes.RECEIVED_CHANNEL_DELETED, data: {id: msg.data.channel_id, team_id: msg.broadcast.team_id, deleteAt: msg.data.delete_at}});
dispatch({type: ChannelTypes.RECEIVED_CHANNEL_DELETED, data: {id: msg.data.channel_id, team_id: msg.broadcast.team_id, deleteAt: msg.data.delete_at, viewArchivedChannels}});
}
function handlePreferenceChangedEvent(msg) {
......
......@@ -241,7 +241,7 @@ export default class RhsThread extends React.Component {
const {selected, currentUser} = this.props;
let createAt = selected.create_at;
if (!createAt) {
if (!createAt && this.props.posts.length > 0) {
createAt = this.props.posts[this.props.posts.length - 1].create_at;
}
const rootPostDay = Utils.getDateForUnixTicks(createAt);
......@@ -362,7 +362,7 @@ export default class RhsThread extends React.Component {
previewEnabled={this.props.previewEnabled}
isBusy={this.state.isBusy}
/>
{isFakeDeletedPost && <DateSeparator date={rootPostDay}/>}
{isFakeDeletedPost && rootPostDay && <DateSeparator date={rootPostDay}/>}
<div
ref='rhspostlist'
className='post-right-comments-container'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment