Skip to content
Snippets Groups Projects
Commit 7e356503 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Actually complete the autosuggestion feature

parent c49f6290
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ export function fetchComposeSuggestions(token) {
return (dispatch, getState) => {
const loadedCandidates = getState().get('accounts').filter(item => item.get('acct').toLowerCase().slice(0, token.length) === token).map(item => ({
label: item.get('acct'),
completion: item.get('acct').slice(0, token.length)
completion: item.get('acct').slice(token.length)
})).toList().toJS();
dispatch(readyComposeSuggestions(loadedCandidates));
......
......@@ -31,10 +31,10 @@ const getTokenForSuggestions = (str, caretPosition) => {
}
};
const getSuggestionValue = suggestion => suggestion;
const getSuggestionValue = suggestion => suggestion.completion;
const renderSuggestion = suggestion => (
<span>{suggestion}</span>
<span>{suggestion.label}</span>
);
const textareaStyle = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment