From b003ac06342c580e4922b48b576cd838258babb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 13 Mar 2022 21:09:58 +0100 Subject: [PATCH] Fix: Delete end edit on Markdown post loses Markdown setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/actions/statuses.js | 5 +++-- app/soapbox/reducers/compose.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/soapbox/actions/statuses.js b/app/soapbox/actions/statuses.js index b529e9b23..a37a840f9 100644 --- a/app/soapbox/actions/statuses.js +++ b/app/soapbox/actions/statuses.js @@ -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 => { diff --git a/app/soapbox/reducers/compose.js b/app/soapbox/reducers/compose.js index 57796af63..2690b6637 100644 --- a/app/soapbox/reducers/compose.js +++ b/app/soapbox/reducers/compose.js @@ -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);