From fa046ccf06c153acbbdb0af101248c2ce05c70d5 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 26 Dec 2016 09:35:34 -0500 Subject: On channel switch, only pull statuses the client doesn't have yet (#4894) --- webapp/actions/status_actions.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'webapp/actions') 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)); -- cgit v1.2.3-1-g7c22