Merge branch 'redraft-mimetype' into 'develop'

Fix: Delete end edit on Markdown post loses Markdown setting

Closes #590

See merge request soapbox-pub/soapbox-fe!1096
remove-makegetotheraccounts
marcin mikołajczak 2022-03-13 20:25:52 +00:00
commit ac55adfcb3
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -97,7 +97,7 @@ export function fetchStatus(id) {
};
}
export function redraft(status, raw_text) {
export function redraft(status, raw_text, content_type) {
return (dispatch, getState) => {
const state = getState();
const instance = state.get('instance');
@ -108,6 +108,7 @@ export function redraft(status, raw_text) {
status,
raw_text,
explicitAddressing,
content_type,
});
};
}
@ -129,7 +130,7 @@ export function deleteStatus(id, routerHistory, withRedraft = false) {
dispatch(deleteFromTimelines(id));
if (withRedraft) {
dispatch(redraft(status, response.data.text));
dispatch(redraft(status, response.data.text, response.data.pleroma?.content_type));
dispatch(openModal('COMPOSE'));
}
}).catch(error => {

Wyświetl plik

@ -436,7 +436,7 @@ export default function compose(state = initialState, action) {
map.set('focusDate', new Date());
map.set('caretPosition', null);
map.set('idempotencyKey', uuid());
map.set('content_type', action.status.get('content_type'));
map.set('content_type', action.content_type || 'text/plain');
if (action.status.get('spoiler_text').length > 0) {
map.set('spoiler', true);