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