From dc3536a9f89164c2bcd568fabfb9742b7bc61141 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 12 Jul 2017 09:14:32 -0400 Subject: Properly load user statuses for posts in channel (#6907) --- webapp/actions/status_actions.jsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'webapp') diff --git a/webapp/actions/status_actions.jsx b/webapp/actions/status_actions.jsx index cbad8e4c0..e8559bd65 100644 --- a/webapp/actions/status_actions.jsx +++ b/webapp/actions/status_actions.jsx @@ -54,16 +54,9 @@ export function loadStatusesForChannelAndSidebar() { const statusesToLoad = {}; const channelId = ChannelStore.getCurrentId(); - const postList = PostStore.getVisiblePosts(channelId); - if (postList && postList.posts) { - for (const pid in postList.posts) { - if (!postList.posts.hasOwnProperty(pid)) { - continue; - } - - const post = postList.posts[pid]; - statusesToLoad[post.user_id] = true; - } + const posts = PostStore.getVisiblePosts(channelId) || []; + for (const post of posts) { + statusesToLoad[post.user_id] = true; } const dmPrefs = PreferenceStore.getCategory(Preferences.CATEGORY_DIRECT_CHANNEL_SHOW); -- cgit v1.2.3-1-g7c22