summaryrefslogtreecommitdiffstats
path: root/web/react/dispatcher/event_helpers.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/dispatcher/event_helpers.jsx')
-rw-r--r--web/react/dispatcher/event_helpers.jsx43
1 files changed, 40 insertions, 3 deletions
diff --git a/web/react/dispatcher/event_helpers.jsx b/web/react/dispatcher/event_helpers.jsx
index 856eec2f1..306c59e8b 100644
--- a/web/react/dispatcher/event_helpers.jsx
+++ b/web/react/dispatcher/event_helpers.jsx
@@ -10,9 +10,9 @@ import * as AsyncClient from '../utils/async_client.jsx';
import * as Client from '../utils/client.jsx';
export function emitChannelClickEvent(channel) {
- AsyncClient.getChannels();
- AsyncClient.getChannelExtraInfo();
- AsyncClient.updateLastViewedAt();
+ AsyncClient.getChannels(true);
+ AsyncClient.getChannelExtraInfo(channel.id);
+ AsyncClient.updateLastViewedAt(channel.id);
AsyncClient.getPosts(channel.id);
AppDispatcher.handleViewAction({
@@ -111,3 +111,40 @@ export function showRegisterAppModal() {
value: true
});
}
+
+export function emitSuggestionPretextChanged(suggestionId, pretext) {
+ AppDispatcher.handleViewAction({
+ type: ActionTypes.SUGGESTION_PRETEXT_CHANGED,
+ id: suggestionId,
+ pretext
+ });
+}
+
+export function emitSelectNextSuggestion(suggestionId) {
+ AppDispatcher.handleViewAction({
+ type: ActionTypes.SUGGESTION_SELECT_NEXT,
+ id: suggestionId
+ });
+}
+
+export function emitSelectPreviousSuggestion(suggestionId) {
+ AppDispatcher.handleViewAction({
+ type: ActionTypes.SUGGESTION_SELECT_PREVIOUS,
+ id: suggestionId
+ });
+}
+
+export function emitCompleteWordSuggestion(suggestionId, term = '') {
+ AppDispatcher.handleViewAction({
+ type: Constants.ActionTypes.SUGGESTION_COMPLETE_WORD,
+ id: suggestionId,
+ term
+ });
+}
+
+export function emitClearSuggestions(suggestionId) {
+ AppDispatcher.handleViewAction({
+ type: Constants.ActionTypes.SUGGESTION_CLEAR_SUGGESTIONS,
+ id: suggestionId
+ });
+}