Fix mutating objects

master
Eugen Rochko 8 years ago
parent d4559402e4
commit d5da55c6cc
  1. 6
      app/assets/javascripts/components/actions/compose.jsx

@ -69,9 +69,9 @@ export function submitCompose() {
sensitive: getState().getIn(['compose', 'sensitive']), sensitive: getState().getIn(['compose', 'sensitive']),
unlisted: getState().getIn(['compose', 'unlisted']) unlisted: getState().getIn(['compose', 'unlisted'])
}).then(function (response) { }).then(function (response) {
dispatch(submitComposeSuccess(response.data)); dispatch(submitComposeSuccess({ ...response.data }));
dispatch(updateTimeline('home', response.data)); dispatch(updateTimeline('home', { ...response.data }));
dispatch(updateTimeline('public', response.data)); dispatch(updateTimeline('public', { ...response.data }));
}).catch(function (error) { }).catch(function (error) {
dispatch(submitComposeFail(error)); dispatch(submitComposeFail(error));
}); });

Loading…
Cancel
Save