diff options
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/async_client.jsx | 58 | ||||
-rw-r--r-- | web/react/utils/channel_intro_messages.jsx | 2 | ||||
-rw-r--r-- | web/react/utils/constants.jsx | 58 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 2 |
4 files changed, 60 insertions, 60 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index c5957e8cc..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'; @@ -17,7 +18,7 @@ var callTracker = {}; export function dispatchError(err, method) { AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_ERROR, + type: ActionTypes.RECEIVED_ERROR, err: err, method: method }); @@ -70,7 +71,7 @@ export function getChannels(checkVersion) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_CHANNELS, + type: ActionTypes.RECEIVED_CHANNELS, channels: data.channels, members: data.members }); @@ -98,7 +99,7 @@ export function getChannel(id) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_CHANNEL, + type: ActionTypes.RECEIVED_CHANNEL, channel: data.channel, member: data.member }); @@ -155,7 +156,7 @@ export function getMoreChannels(force) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_MORE_CHANNELS, + type: ActionTypes.RECEIVED_MORE_CHANNELS, channels: data.channels, members: data.members }); @@ -194,7 +195,7 @@ export function getChannelExtraInfo(id, memberLimit) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_CHANNEL_EXTRA_INFO, + type: ActionTypes.RECEIVED_CHANNEL_EXTRA_INFO, extra_info: data }); }, @@ -221,7 +222,7 @@ export function getProfiles() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_PROFILES, + type: ActionTypes.RECEIVED_PROFILES, profiles: data }); }, @@ -248,7 +249,7 @@ export function getSessions() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_SESSIONS, + type: ActionTypes.RECEIVED_SESSIONS, sessions: data }); }, @@ -275,7 +276,7 @@ export function getAudits() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_AUDITS, + type: ActionTypes.RECEIVED_AUDITS, audits: data }); }, @@ -301,7 +302,7 @@ export function getLogs() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_LOGS, + type: ActionTypes.RECEIVED_LOGS, logs: data }); }, @@ -327,7 +328,7 @@ export function getServerAudits() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_SERVER_AUDITS, + type: ActionTypes.RECEIVED_SERVER_AUDITS, audits: data }); }, @@ -353,7 +354,7 @@ export function getConfig() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_CONFIG, + type: ActionTypes.RECEIVED_CONFIG, config: data }); }, @@ -379,7 +380,7 @@ export function getAllTeams() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_ALL_TEAMS, + type: ActionTypes.RECEIVED_ALL_TEAMS, teams: data }); }, @@ -408,7 +409,7 @@ export function findTeams(email) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_TEAMS, + type: ActionTypes.RECEIVED_TEAMS, teams: data }); }, @@ -436,7 +437,7 @@ export function search(terms) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_SEARCH, + type: ActionTypes.RECEIVED_SEARCH, results: data }); }, @@ -488,7 +489,7 @@ export function getPostsPage(id, maxPosts) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_POSTS, + type: ActionTypes.RECEIVED_POSTS, id: channelId, before: true, numRequested: numPosts, @@ -538,7 +539,7 @@ export function getPosts(id) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_POSTS, + type: ActionTypes.RECEIVED_POSTS, id: channelId, before: true, numRequested: Constants.POST_CHUNK_SIZE, @@ -577,7 +578,7 @@ export function getPostsBefore(postId, offset, numPost) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_POSTS, + type: ActionTypes.RECEIVED_POSTS, id: channelId, before: true, numRequested: numPost, @@ -616,7 +617,7 @@ export function getPostsAfter(postId, offset, numPost) { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_POSTS, + type: ActionTypes.RECEIVED_POSTS, id: channelId, before: false, numRequested: numPost, @@ -649,7 +650,7 @@ export function getMe() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_ME, + type: ActionTypes.RECEIVED_ME, me: data }); }, @@ -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); } } @@ -685,7 +685,7 @@ export function getStatuses() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_STATUSES, + type: ActionTypes.RECEIVED_STATUSES, statuses: data }); }, @@ -711,7 +711,7 @@ export function getMyTeam() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_TEAM, + type: ActionTypes.RECEIVED_TEAM, team: data }); }, @@ -737,7 +737,7 @@ export function getAllPreferences() { } AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_PREFERENCES, + type: ActionTypes.RECEIVED_PREFERENCES, preferences: data }); }, @@ -754,7 +754,7 @@ export function savePreferences(preferences, success, error) { (data, textStatus, xhr) => { if (xhr.status !== 304) { AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_PREFERENCES, + type: ActionTypes.RECEIVED_PREFERENCES, preferences }); } @@ -821,7 +821,7 @@ export function getFileInfo(filename) { callTracker[callName] = 0; AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_FILE_INFO, + type: ActionTypes.RECEIVED_FILE_INFO, filename, info: data }); diff --git a/web/react/utils/channel_intro_messages.jsx b/web/react/utils/channel_intro_messages.jsx index 69e08f143..1aca0467e 100644 --- a/web/react/utils/channel_intro_messages.jsx +++ b/web/react/utils/channel_intro_messages.jsx @@ -128,7 +128,7 @@ export function createDefaultIntroMessage(channel) { <div className='channel-intro'> <FormattedHTMLMessage id='intro_messages.default' - defaultMessage="<h4 class='channel-intro__title'>Beginning of {display_name}</h4><p class='channel-intro__content'><strong>Welcome to {display_name}!'</strong><br/><br/>This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.</p>" + defaultMessage="<h4 class='channel-intro__title'>Beginning of {display_name}</h4><p class='channel-intro__content'><strong>Welcome to {display_name}!</strong><br/><br/>This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.</p>" values={{ display_name: channel.display_name }} diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index d78776aa3..d7d8a2ced 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -5,7 +5,7 @@ import keyMirror from 'keymirror'; export default { ActionTypes: keyMirror({ - RECIEVED_ERROR: null, + RECEIVED_ERROR: null, CLICK_CHANNEL: null, CREATE_CHANNEL: null, @@ -14,40 +14,40 @@ export default { POST_DELETED: null, REMOVE_POST: null, - RECIEVED_CHANNELS: null, - RECIEVED_CHANNEL: null, - RECIEVED_MORE_CHANNELS: null, - RECIEVED_CHANNEL_EXTRA_INFO: null, + RECEIVED_CHANNELS: null, + RECEIVED_CHANNEL: null, + RECEIVED_MORE_CHANNELS: null, + RECEIVED_CHANNEL_EXTRA_INFO: null, FOCUS_POST: null, - RECIEVED_POSTS: null, - RECIEVED_FOCUSED_POST: null, - RECIEVED_POST: null, - RECIEVED_EDIT_POST: null, - RECIEVED_SEARCH: null, - RECIEVED_SEARCH_TERM: null, - RECIEVED_POST_SELECTED: null, - RECIEVED_MENTION_DATA: null, - RECIEVED_ADD_MENTION: null, + RECEIVED_POSTS: null, + RECEIVED_FOCUSED_POST: null, + RECEIVED_POST: null, + RECEIVED_EDIT_POST: null, + RECEIVED_SEARCH: null, + RECEIVED_SEARCH_TERM: null, + RECEIVED_POST_SELECTED: null, + RECEIVED_MENTION_DATA: null, + RECEIVED_ADD_MENTION: null, - RECIEVED_PROFILES: null, - RECIEVED_ME: null, - RECIEVED_SESSIONS: null, - RECIEVED_AUDITS: null, - RECIEVED_TEAMS: null, - RECIEVED_STATUSES: null, - RECIEVED_PREFERENCE: null, - RECIEVED_PREFERENCES: null, - RECIEVED_FILE_INFO: null, + RECEIVED_PROFILES: null, + RECEIVED_ME: null, + RECEIVED_SESSIONS: null, + RECEIVED_AUDITS: null, + RECEIVED_TEAMS: null, + RECEIVED_STATUSES: null, + RECEIVED_PREFERENCE: null, + RECEIVED_PREFERENCES: null, + RECEIVED_FILE_INFO: null, - RECIEVED_MSG: null, + RECEIVED_MSG: null, - RECIEVED_TEAM: null, + RECEIVED_TEAM: null, - RECIEVED_CONFIG: null, - RECIEVED_LOGS: null, - RECIEVED_SERVER_AUDITS: null, - RECIEVED_ALL_TEAMS: null, + RECEIVED_CONFIG: null, + RECEIVED_LOGS: null, + RECEIVED_SERVER_AUDITS: null, + RECEIVED_ALL_TEAMS: null, SHOW_SEARCH: null, diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 4beec8d64..238a209a4 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -490,7 +490,7 @@ export function insertHtmlEntities(text) { export function searchForTerm(term) { AppDispatcher.handleServerAction({ - type: ActionTypes.RECIEVED_SEARCH_TERM, + type: ActionTypes.RECEIVED_SEARCH_TERM, term: term, do_search: true }); |