diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-07-12 09:14:32 -0400 |
---|---|---|
committer | Saturnino Abril <saturnino.abril@gmail.com> | 2017-07-12 22:14:32 +0900 |
commit | dc3536a9f89164c2bcd568fabfb9742b7bc61141 (patch) | |
tree | 00dcdcc516eb4e3e18ee95904c45bd8d14bcfa54 /webapp/actions/status_actions.jsx | |
parent | 0a78d588954b31eba946c6e656fd6fa33c504a72 (diff) | |
download | chat-dc3536a9f89164c2bcd568fabfb9742b7bc61141.tar.gz chat-dc3536a9f89164c2bcd568fabfb9742b7bc61141.tar.bz2 chat-dc3536a9f89164c2bcd568fabfb9742b7bc61141.zip |
Properly load user statuses for posts in channel (#6907)
Diffstat (limited to 'webapp/actions/status_actions.jsx')
-rw-r--r-- | webapp/actions/status_actions.jsx | 13 |
1 files changed, 3 insertions, 10 deletions
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); |