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