[Glitch] Fix emoji autosuggestions

Port 784c88e16d to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Eugen Rochko
2019-07-29 15:04:49 +02:00
committed by ThibG
parent be8b0e8d06
commit 3c70fb9146
4 changed files with 17 additions and 17 deletions

View File

@@ -444,13 +444,13 @@ export const readyComposeSuggestionsTags = (token, tags) => ({
export function selectComposeSuggestion(position, token, suggestion, path) {
return (dispatch, getState) => {
let completion;
if (typeof suggestion === 'object' && suggestion.id) {
if (suggestion.type === 'emoji') {
dispatch(useEmoji(suggestion));
completion = suggestion.native || suggestion.colons;
} else if (typeof suggestion === 'object' && suggestion.name) {
} else if (suggestion.type === 'hashtag') {
completion = `#${suggestion.name}`;
} else {
completion = '@' + getState().getIn(['accounts', suggestion, 'acct']);
} else if (suggestion.type === 'account') {
completion = '@' + getState().getIn(['accounts', suggestion.id, 'acct']);
}
dispatch({