import api from '../api'
+import { updateTimeline } from './timelines';
+
export const COMPOSE_CHANGE = 'COMPOSE_CHANGE';
export const COMPOSE_SUBMIT_REQUEST = 'COMPOSE_SUBMIT_REQUEST';
export const COMPOSE_SUBMIT_SUCCESS = 'COMPOSE_SUBMIT_SUCCESS';
};
export function submitComposeSuccess(status) {
- return {
- type: COMPOSE_SUBMIT_SUCCESS,
- status: status
+ return (dispatch, getState) => {
+ dispatch({
+ type: COMPOSE_SUBMIT_SUCCESS,
+ status: status
+ });
+
+ dispatch(updateTimeline('home', status));
};
};
state = normalizeStatus(state, status);
state = state.update(timeline, list => {
+ if (list.includes(status.get('id'))) {
+ return list;
+ }
+
const reblogOfId = status.getIn(['reblog', 'id'], null);
if (reblogOfId !== null) {