parent
e7ff8111b1
commit
f4879c4481
|
@ -93,12 +93,13 @@ export const ensureComposeIsVisible = (getState, routerHistory) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export function setComposeToStatus(status, text, spoiler_text) {
|
export function setComposeToStatus(status, text, spoiler_text, content_type) {
|
||||||
return{
|
return{
|
||||||
type: COMPOSE_SET_STATUS,
|
type: COMPOSE_SET_STATUS,
|
||||||
status,
|
status,
|
||||||
text,
|
text,
|
||||||
spoiler_text,
|
spoiler_text,
|
||||||
|
content_type,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ export const editStatus = (id, routerHistory) => (dispatch, getState) => {
|
||||||
api(getState).get(`/api/v1/statuses/${id}/source`).then(response => {
|
api(getState).get(`/api/v1/statuses/${id}/source`).then(response => {
|
||||||
dispatch(fetchStatusSourceSuccess());
|
dispatch(fetchStatusSourceSuccess());
|
||||||
ensureComposeIsVisible(getState, routerHistory);
|
ensureComposeIsVisible(getState, routerHistory);
|
||||||
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text));
|
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text, response.data.content_type));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch(fetchStatusSourceFail(error));
|
dispatch(fetchStatusSourceFail(error));
|
||||||
});
|
});
|
||||||
|
|
|
@ -599,6 +599,7 @@ export default function compose(state = initialState, action) {
|
||||||
return state.withMutations(map => {
|
return state.withMutations(map => {
|
||||||
map.set('id', action.status.get('id'));
|
map.set('id', action.status.get('id'));
|
||||||
map.set('text', action.text);
|
map.set('text', action.text);
|
||||||
|
map.set('content_type', action.content_type || 'text/plain');
|
||||||
map.set('in_reply_to', action.status.get('in_reply_to_id'));
|
map.set('in_reply_to', action.status.get('in_reply_to_id'));
|
||||||
map.set('privacy', action.status.get('visibility'));
|
map.set('privacy', action.status.get('visibility'));
|
||||||
map.set('media_attachments', action.status.get('media_attachments'));
|
map.set('media_attachments', action.status.get('media_attachments'));
|
||||||
|
|
Loading…
Reference in New Issue