summaryrefslogtreecommitdiffstats
path: root/web/react/utils/async_client.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-02-05 07:42:42 -0800
committerCorey Hulen <corey@hulen.com>2016-02-05 07:42:42 -0800
commit9b8761df8de0b7b4dcda55ecce7750dc385e38c8 (patch)
tree9019751c4a75896727b6bef62d8cfec566a7ed27 /web/react/utils/async_client.jsx
parent5f1257bb89b148304c32dd191b3738cf0d629bfd (diff)
parente6a7594d70dfde30e3dbb36d45e5d1458883553f (diff)
downloadchat-9b8761df8de0b7b4dcda55ecce7750dc385e38c8.tar.gz
chat-9b8761df8de0b7b4dcda55ecce7750dc385e38c8.tar.bz2
chat-9b8761df8de0b7b4dcda55ecce7750dc385e38c8.zip
Merge pull request #2087 from hmhealey/plt1758
PLT-1758 Changed CommandProvider to only set the matched pretext if it actuall…
Diffstat (limited to 'web/react/utils/async_client.jsx')
-rw-r--r--web/react/utils/async_client.jsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 328a7a7f2..c5957e8cc 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -789,14 +789,16 @@ export function getSuggestedCommands(command, suggestionId, component) {
// pull out the suggested commands from the returned data
const terms = matches.map((suggestion) => suggestion.suggestion);
- AppDispatcher.handleServerAction({
- type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
- id: suggestionId,
- matchedPretext: command,
- terms,
- items: matches,
- component
- });
+ if (terms.length > 0) {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
+ id: suggestionId,
+ matchedPretext: command,
+ terms,
+ items: matches,
+ component
+ });
+ }
},
(err) => {
dispatchError(err, 'getCommandSuggestions');