From 3380e964497945a5e81012eee3ec65917ac0ade0 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 28 Jul 2019 14:37:52 +0200 Subject: [Glitch] Add autosuggestions for hashtags Port cfb2ed78231758a79af038a964ab7f7b7b35274e to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/components/autosuggest_input.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/javascript/flavours/glitch/components/autosuggest_input.js') diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js index 5fc952d8e..f931069a9 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,12 +168,12 @@ export default class AutosuggestInput extends ImmutablePureComponent { const { selectedSuggestion } = this.state; let inner, key; - if (typeof suggestion === 'object') { + if (typeof suggestion === 'object' && suggestion.shortcode) { inner = ; key = suggestion.id; - } else if (suggestion[0] === '#') { - inner = suggestion; - key = suggestion; + } else if (typeof suggestion === 'object' && suggestion.name) { + inner = ; + key = suggestion.name; } else { inner = ; key = suggestion; -- cgit