about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/autosuggest_textarea.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-07-28 16:28:05 +0200
committerThibaut Girka <thib@sitedethib.com>2019-07-28 16:28:05 +0200
commitbca3825c17dd2087f826d9269bb80537bd4ff395 (patch)
tree51043b99ec56d263f9d126091afb923292a9e301 /app/javascript/mastodon/components/autosuggest_textarea.js
parent91da921dbb51f55bc926c3997ae558d735292a67 (diff)
parentcfb2ed78231758a79af038a964ab7f7b7b35274e (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/javascript/mastodon/components/autosuggest_textarea.js')
-rw-r--r--app/javascript/mastodon/components/autosuggest_textarea.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/javascript/mastodon/components/autosuggest_textarea.js b/app/javascript/mastodon/components/autosuggest_textarea.js
index b070fe3e5..2bd06d28a 100644
--- a/app/javascript/mastodon/components/autosuggest_textarea.js
+++ b/app/javascript/mastodon/components/autosuggest_textarea.js
@@ -1,6 +1,7 @@
 import React from 'react';
 import AutosuggestAccountContainer from '../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 '../rtl';
@@ -173,12 +174,12 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
     const { selectedSuggestion } = this.state;
     let inner, key;
 
-    if (typeof suggestion === 'object') {
+    if (typeof suggestion === 'object' && suggestion.shortcode) {
       inner = <AutosuggestEmoji emoji={suggestion} />;
       key   = suggestion.id;
-    } else if (suggestion[0] === '#') {
-      inner = suggestion;
-      key   = suggestion;
+    } else if (typeof suggestion === 'object' && suggestion.name) {
+      inner = <AutosuggestHashtag tag={suggestion} />;
+      key   = suggestion.name;
     } else {
       inner = <AutosuggestAccountContainer id={suggestion} />;
       key   = suggestion;