Fix JS error when deleting post that has comments (#6381)

This commit is contained in:
Joram Wilander
2017-05-10 09:49:16 -04:00
committed by GitHub
parent 74b51d1f27
commit 2b7e71e47a

View File

@@ -324,8 +324,6 @@ export default class RhsThread extends React.Component {
const postsArray = this.state.postsArray;
const selected = this.state.selected;
const profiles = this.state.profiles || {};
const rootPostDay = Utils.getDateForUnixTicks(selected.create_at);
let previousPostDay = rootPostDay;
if (postsArray == null || selected == null) {
return (
@@ -333,6 +331,9 @@ export default class RhsThread extends React.Component {
);
}
const rootPostDay = Utils.getDateForUnixTicks(selected.create_at);
let previousPostDay = rootPostDay;
let profile;
if (UserStore.getCurrentId() === selected.user_id) {
profile = this.props.currentUser;