summaryrefslogtreecommitdiffstats
path: root/web/react/stores
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-12-01 10:54:53 -0500
committerhmhealey <harrisonmhealey@gmail.com>2015-12-01 16:27:22 -0500
commit0c449ba5c98b4200ac255e2e6b70b754452a861e (patch)
tree9f52f450c8f9ae28c51246cfe3c2fb8da8303eca /web/react/stores
parent713115be51cbc20e90be2153772e6f184ce7c76d (diff)
downloadchat-0c449ba5c98b4200ac255e2e6b70b754452a861e.tar.gz
chat-0c449ba5c98b4200ac255e2e6b70b754452a861e.tar.bz2
chat-0c449ba5c98b4200ac255e2e6b70b754452a861e.zip
Replaced CommandList with the new suggestion components
Diffstat (limited to 'web/react/stores')
-rw-r--r--web/react/stores/suggestion_store.jsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/web/react/stores/suggestion_store.jsx b/web/react/stores/suggestion_store.jsx
index 8e64d02a3..5bd13b02d 100644
--- a/web/react/stores/suggestion_store.jsx
+++ b/web/react/stores/suggestion_store.jsx
@@ -223,11 +223,13 @@ class SuggestionStore extends EventEmitter {
this.emitSuggestionsChanged(id);
break;
case ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS:
- this.setMatchedPretext(id, other.matchedPretext);
- this.addSuggestions(id, other.terms, other.items, other.componentType);
+ if (other.matchedPretext === this.getMatchedPretext(id)) {
+ // ensure the matched pretext hasn't changed so that we don't receive suggestions for outdated pretext
+ this.addSuggestions(id, other.terms, other.items, other.component);
- this.ensureSelectionExists(id);
- this.emitSuggestionsChanged(id);
+ this.ensureSelectionExists(id);
+ this.emitSuggestionsChanged(id);
+ }
break;
case ActionTypes.SUGGESTION_SELECT_NEXT:
this.selectNext(id);