From 0405ef977a3ba37b3da472733e59be6db7bd7b99 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 3 Nov 2016 19:52:09 +0100 Subject: [PATCH] Aria-labels actually didn't work in React, so removing. Fixing some bugs --- app/assets/javascripts/components/actions/compose.jsx | 11 ++++------- .../features/ui/components/compose_form.jsx | 1 - .../components/features/ui/components/follow_form.jsx | 2 +- .../javascripts/components/reducers/accounts.jsx | 3 ++- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/components/actions/compose.jsx b/app/assets/javascripts/components/actions/compose.jsx index 228469df1..d343867dd 100644 --- a/app/assets/javascripts/components/actions/compose.jsx +++ b/app/assets/javascripts/components/actions/compose.jsx @@ -55,6 +55,7 @@ export function submitCompose() { media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')) }).then(function (response) { dispatch(submitComposeSuccess(response.data)); + dispatch(updateTimeline('home', response.data)); }).catch(function (error) { dispatch(submitComposeFail(error)); }); @@ -68,13 +69,9 @@ export function submitComposeRequest() { }; export function submitComposeSuccess(status) { - return (dispatch, getState) => { - dispatch({ - type: COMPOSE_SUBMIT_SUCCESS, - status: status - }); - - dispatch(updateTimeline('home', status)); + return { + type: COMPOSE_SUBMIT_SUCCESS, + status: status }; }; diff --git a/app/assets/javascripts/components/features/ui/components/compose_form.jsx b/app/assets/javascripts/components/features/ui/components/compose_form.jsx index e54641347..0655a7c79 100644 --- a/app/assets/javascripts/components/features/ui/components/compose_form.jsx +++ b/app/assets/javascripts/components/features/ui/components/compose_form.jsx @@ -132,7 +132,6 @@ const ComposeForm = React.createClass({ const inputProps = { placeholder: 'What is on your mind?', - arialabel: 'What is on your mind?', value: this.props.text, onKeyUp: this.handleKeyUp, onChange: this.handleChange, diff --git a/app/assets/javascripts/components/features/ui/components/follow_form.jsx b/app/assets/javascripts/components/features/ui/components/follow_form.jsx index be80b7663..4ba5dfc25 100644 --- a/app/assets/javascripts/components/features/ui/components/follow_form.jsx +++ b/app/assets/javascripts/components/features/ui/components/follow_form.jsx @@ -33,7 +33,7 @@ const FollowForm = React.createClass({ render () { return (
- +
); diff --git a/app/assets/javascripts/components/reducers/accounts.jsx b/app/assets/javascripts/components/reducers/accounts.jsx index bc2144752..f01144786 100644 --- a/app/assets/javascripts/components/reducers/accounts.jsx +++ b/app/assets/javascripts/components/reducers/accounts.jsx @@ -71,11 +71,12 @@ export default function accounts(state = initialState, action) { case ACCOUNT_TIMELINE_EXPAND_SUCCESS: case CONTEXT_FETCH_SUCCESS: return normalizeAccountsFromStatuses(state, action.statuses); - case TIMELINE_UPDATE: case REBLOG_SUCCESS: case FAVOURITE_SUCCESS: case UNREBLOG_SUCCESS: case UNFAVOURITE_SUCCESS: + return normalizeAccountFromStatus(state, action.response); + case TIMELINE_UPDATE: case STATUS_FETCH_SUCCESS: return normalizeAccountFromStatus(state, action.status); default: