From 41535074623646862408c86a45e4fd26f48cf182 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 25 Feb 2016 12:46:23 -0500
Subject: Another fix for RHS thread profiles

---
 web/react/components/rhs_thread.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'web/react/components/rhs_thread.jsx')

diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx
index 4d770287c..5e782b09b 100644
--- a/web/react/components/rhs_thread.jsx
+++ b/web/react/components/rhs_thread.jsx
@@ -185,7 +185,7 @@ export default class RhsThread extends React.Component {
                         <div className='post-right-comments-container'>
                         {postsArray.map(function mapPosts(comPost) {
                             let p;
-                            if (UserStore.getCurrentId() === selected.user_id) {
+                            if (UserStore.getCurrentId() === comPost.user_id) {
                                 p = UserStore.getCurrentUser();
                             } else {
                                 p = profiles[comPost.user_id];
-- 
cgit v1.2.3-1-g7c22


From 04f6b0b86cf43ffedd96c59dcce4972831507ce9 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 25 Feb 2016 14:14:52 -0500
Subject: Fix deleting threads

---
 web/react/components/rhs_thread.jsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'web/react/components/rhs_thread.jsx')

diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx
index 5e782b09b..292624846 100644
--- a/web/react/components/rhs_thread.jsx
+++ b/web/react/components/rhs_thread.jsx
@@ -91,9 +91,11 @@ export default class RhsThread extends React.Component {
         });
     }
     onPostChange() {
-        const selected = PostStore.getSelectedPost();
-        const posts = PostStore.getSelectedPostThread();
-        this.setState({posts, selected});
+        if (this.mounted) {
+            const selected = PostStore.getSelectedPost();
+            const posts = PostStore.getSelectedPostThread();
+            this.setState({posts, selected});
+        }
     }
     onUserChange() {
         const profiles = JSON.parse(JSON.stringify(UserStore.getProfiles()));
-- 
cgit v1.2.3-1-g7c22

