about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/autosuggest_input.js
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-09-07 13:03:02 -0700
committerReverite <github@reverite.sh>2019-09-07 13:03:02 -0700
commit2486f5f825ae861cdf97529f64dc4e658ddab279 (patch)
treeeebbd191c621baa43a93b26d97d4766cf7ebf9cd /app/javascript/flavours/glitch/components/autosuggest_input.js
parent54bf56d9e019e29c1509a2c5a0f23e4f1df65c90 (diff)
parent286bf110c3e69042049968440f1eb99372a7e0e6 (diff)
Merge branch 'glitch' into production
Diffstat (limited to 'app/javascript/flavours/glitch/components/autosuggest_input.js')
-rw-r--r--app/javascript/flavours/glitch/components/autosuggest_input.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js
index 5fc952d8e..1ef7ee216 100644
--- a/app/javascript/flavours/glitch/components/autosuggest_input.js
+++ b/app/javascript/flavours/glitch/components/autosuggest_input.js
@@ -1,6 +1,7 @@
 import React from 'react';
 import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container';
 import AutosuggestEmoji from './autosuggest_emoji';
+import AutosuggestHashtag from './autosuggest_hashtag';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { isRtl } from 'flavours/glitch/util/rtl';
@@ -167,15 +168,15 @@ export default class AutosuggestInput extends ImmutablePureComponent {
     const { selectedSuggestion } = this.state;
     let inner, key;
 
-    if (typeof suggestion === 'object') {
+    if (suggestion.type === 'emoji') {
       inner = <AutosuggestEmoji emoji={suggestion} />;
       key   = suggestion.id;
-    } else if (suggestion[0] === '#') {
-      inner = suggestion;
-      key   = suggestion;
-    } else {
-      inner = <AutosuggestAccountContainer id={suggestion} />;
-      key   = suggestion;
+    } else if (suggestion.type ==='hashtag') {
+      inner = <AutosuggestHashtag tag={suggestion} />;
+      key   = suggestion.name;
+    } else if (suggestion.type === 'account') {
+      inner = <AutosuggestAccountContainer id={suggestion.id} />;
+      key   = suggestion.id;
     }
 
     return (