summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-02-08 12:59:29 -0500
committerChristopher Speller <crspeller@gmail.com>2016-02-08 12:59:29 -0500
commit0d47dd0a0eb32e2364c68f706e6e9a463cb05953 (patch)
tree19badc7930ac714ecff72ca38c84e7bbdb4f67b9 /web/react/utils/async_client.jsx
parent0fcb4252c8f873f5c28c08fc600368cf8d1fe6a8 (diff)
parenta3e83abc14412d871b0befd3658e8ad48c92e786 (diff)
downloadchat-0d47dd0a0eb32e2364c68f706e6e9a463cb05953.tar.gz
chat-0d47dd0a0eb32e2364c68f706e6e9a463cb05953.tar.bz2
chat-0d47dd0a0eb32e2364c68f706e6e9a463cb05953.zip
Merge pull request #2095 from mattermost/plt-1787
PLT-1787 Fix statuses not rendering until a change in the LHS
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index c6664ae21..d5fc10b8f 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -5,6 +5,7 @@ import * as client from './client.jsx';
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import BrowserStore from '../stores/browser_store.jsx';
import ChannelStore from '../stores/channel_store.jsx';
+import PreferenceStore from '../stores/preference_store.jsx';
import PostStore from '../stores/post_store.jsx';
import UserStore from '../stores/user_store.jsx';
import * as utils from './utils.jsx';
@@ -661,13 +662,12 @@ export function getMe() {
}
export function getStatuses() {
- const directChannels = ChannelStore.getAll().filter((channel) => channel.type === Constants.DM_CHANNEL);
+ const preferences = PreferenceStore.getCategory(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW);
const teammateIds = [];
- for (var i = 0; i < directChannels.length; i++) {
- const teammate = utils.getDirectTeammate(directChannels[i].id);
- if (teammate) {
- teammateIds.push(teammate.id);
+ for (const preference of preferences) {
+ if (preference.value === 'true') {
+ teammateIds.push(preference.name);
}
}