diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-12-26 09:35:34 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-12-26 09:35:34 -0500 |
commit | fa046ccf06c153acbbdb0af101248c2ce05c70d5 (patch) | |
tree | 9247a95f7fd5b8a8370b861526dedef576fcd7a8 /webapp/actions/status_actions.jsx | |
parent | e492b80fb8a08665a79d64b3febc411d380d76eb (diff) | |
download | chat-fa046ccf06c153acbbdb0af101248c2ce05c70d5.tar.gz chat-fa046ccf06c153acbbdb0af101248c2ce05c70d5.tar.bz2 chat-fa046ccf06c153acbbdb0af101248c2ce05c70d5.zip |
On channel switch, only pull statuses the client doesn't have yet (#4894)
Diffstat (limited to 'webapp/actions/status_actions.jsx')
-rw-r--r-- | webapp/actions/status_actions.jsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/webapp/actions/status_actions.jsx b/webapp/actions/status_actions.jsx index c198c52ac..242e6aea0 100644 --- a/webapp/actions/status_actions.jsx +++ b/webapp/actions/status_actions.jsx @@ -6,6 +6,7 @@ import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; import ChannelStore from 'stores/channel_store.jsx'; import PostStore from 'stores/post_store.jsx'; import PreferenceStore from 'stores/preference_store.jsx'; +import UserStore from 'stores/user_store.jsx'; import Client from 'client/web_client.jsx'; @@ -17,6 +18,7 @@ export function loadStatusesForChannel(channelId = ChannelStore.getCurrentId()) return; } + const statuses = UserStore.getStatuses(); const statusesToLoad = {}; for (const pid in postList.posts) { if (!postList.posts.hasOwnProperty(pid)) { @@ -24,7 +26,9 @@ export function loadStatusesForChannel(channelId = ChannelStore.getCurrentId()) } const post = postList.posts[pid]; - statusesToLoad[post.user_id] = true; + if (statuses[post.user_id] == null) { + statusesToLoad[post.user_id] = true; + } } loadStatusesByIds(Object.keys(statusesToLoad)); |