From 846880e8140f827253c1be4c5e216065431f4ee3 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Mon, 16 Jan 2017 18:33:42 -0500
Subject: Clear mention autocomplete if there is no regex match (#5085)

---
 webapp/components/suggestion/at_mention_provider.jsx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'webapp/components/suggestion/at_mention_provider.jsx')

diff --git a/webapp/components/suggestion/at_mention_provider.jsx b/webapp/components/suggestion/at_mention_provider.jsx
index f90266d95..5f79e08ae 100644
--- a/webapp/components/suggestion/at_mention_provider.jsx
+++ b/webapp/components/suggestion/at_mention_provider.jsx
@@ -6,6 +6,7 @@ import Provider from './provider.jsx';
 
 import ChannelStore from 'stores/channel_store.jsx';
 import UserStore from 'stores/user_store.jsx';
+import SuggestionStore from 'stores/suggestion_store.jsx';
 
 import {autocompleteUsersInChannel} from 'actions/user_actions.jsx';
 
@@ -161,6 +162,8 @@ export default class AtMentionProvider extends Provider {
                     });
                 }
             );
+        } else {
+            SuggestionStore.clearSuggestions(suggestionId);
         }
     }
 }
-- 
cgit v1.2.3-1-g7c22

