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
This commit is contained in:
marcin mikołajczak 2022-03-13 20:25:52 +00:00
commit ac55adfcb3
2 changed files with 4 additions and 3 deletions

View File

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

View File

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