summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-08 12:41:26 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-08 12:41:26 -0600
commit3fba8e42b140c1189bf3c06882cce5e2231e63da (patch)
tree7a0721cecf6624fc9c1fd71449628472b941ddeb /web/react/utils/async_client.jsx
parent001a4448ca5fb0018eeb442915b473b121c04bf3 (diff)
downloadchat-3fba8e42b140c1189bf3c06882cce5e2231e63da.tar.gz
chat-3fba8e42b140c1189bf3c06882cce5e2231e63da.tar.bz2
chat-3fba8e42b140c1189bf3c06882cce5e2231e63da.zip
partial fix for UI
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx20
1 files changed, 14 insertions, 6 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index f218270da..78be646ac 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -747,20 +747,28 @@ export function savePreferences(preferences, success, error) {
}
export function getSuggestedCommands(command, suggestionId, component) {
- client.executeCommand(
- '',
- command,
- true,
+ client.listCommands(
(data) => {
+ var matches = [];
+ data.forEach((cmd) => {
+ if (('/' + cmd.trigger).indexOf(command) === 0) {
+ matches.push({
+ suggestion: '/' + cmd.trigger + ' ' + cmd.auto_complete_hint,
+ description: cmd.auto_complete_desc
+ });
+ }
+ });
+
// pull out the suggested commands from the returned data
- const terms = data.suggestions.map((suggestion) => suggestion.suggestion);
+ //const terms = matches.map((suggestion) => suggestion.trigger);
+ const terms = matches.map((suggestion) => suggestion.suggestion);
AppDispatcher.handleServerAction({
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
id: suggestionId,
matchedPretext: command,
terms,
- items: data.suggestions,
+ items: matches,
component
});
},