From 2b7e71e47a0679396e64993b49c6d7c3d4321030 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 10 May 2017 09:49:16 -0400 Subject: [PATCH] Fix JS error when deleting post that has comments (#6381) --- webapp/components/rhs_thread.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx index da958d9d5b..1b4eb720f6 100644 --- a/webapp/components/rhs_thread.jsx +++ b/webapp/components/rhs_thread.jsx @@ -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;