diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-30 18:13:05 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-30 18:13:05 +0100 |
commit | c49f6290eb9c93720bd5407f4320bb0fd6c96ed9 (patch) | |
tree | 6b39ea083c41313b1443d71a6b1adaaf1d31f431 /app/assets/javascripts/components/reducers | |
parent | fa1cc2d05a12783e166f30bf7a0b3239ebccf732 (diff) |
Basic username autocomplete for text area
Diffstat (limited to 'app/assets/javascripts/components/reducers')
-rw-r--r-- | app/assets/javascripts/components/reducers/compose.jsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/reducers/compose.jsx b/app/assets/javascripts/components/reducers/compose.jsx index 1c676326f..85799bf01 100644 --- a/app/assets/javascripts/components/reducers/compose.jsx +++ b/app/assets/javascripts/components/reducers/compose.jsx @@ -10,7 +10,9 @@ import { COMPOSE_UPLOAD_SUCCESS, COMPOSE_UPLOAD_FAIL, COMPOSE_UPLOAD_UNDO, - COMPOSE_UPLOAD_PROGRESS + COMPOSE_UPLOAD_PROGRESS, + COMPOSE_SUGGESTIONS_CLEAR, + COMPOSE_SUGGESTIONS_READY } from '../actions/compose'; import { TIMELINE_DELETE } from '../actions/timelines'; import { ACCOUNT_SET_SELF } from '../actions/accounts'; @@ -22,7 +24,8 @@ const initialState = Immutable.Map({ is_submitting: false, is_uploading: false, progress: 0, - media_attachments: Immutable.List([]), + media_attachments: Immutable.List(), + suggestions: [], me: null }); @@ -95,6 +98,10 @@ export default function compose(state = initialState, action) { return state.set('progress', Math.round((action.loaded / action.total) * 100)); case COMPOSE_MENTION: return state.update('text', text => `${text}@${action.account.get('acct')} `); + case COMPOSE_SUGGESTIONS_CLEAR: + return state.set('suggestions', []); + case COMPOSE_SUGGESTIONS_READY: + return state.set('suggestions', action.accounts); case TIMELINE_DELETE: if (action.id === state.get('in_reply_to')) { return state.set('in_reply_to', null); |