[Glitch] Fix delete & redraft of pending posts

Port ab9aa25cd3 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2026-02-13 11:32:16 +01:00
parent 4046affea9
commit 04e0b85f5b
2 changed files with 4 additions and 3 deletions

View File

@@ -109,7 +109,7 @@ export function fetchStatusFail(id, error, skipLoading, parentQuotePostId) {
};
}
export function redraft(status, raw_text, content_type) {
export function redraft(status, raw_text, content_type, quoted_status_id = null) {
return (dispatch, getState) => {
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
@@ -117,6 +117,7 @@ export function redraft(status, raw_text, content_type) {
type: REDRAFT,
status,
raw_text,
quoted_status_id,
content_type,
maxOptions,
});
@@ -135,7 +136,7 @@ export const editStatus = (id) => (dispatch, getState) => {
api().get(`/api/v1/statuses/${id}/source`).then(response => {
dispatch(fetchStatusSourceSuccess());
ensureComposeIsVisible(getState);
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text, response.data.content_type));
dispatch(setComposeToStatus(status, response.data.text, response.data.spoiler_text, response.data.content_type, response.data.quote?.quoted_status?.id));
}).catch(error => {
dispatch(fetchStatusSourceFail(error));
});

View File

@@ -646,7 +646,7 @@ export const composeReducer = (state = initialState, action) => {
map => map.merge(new ImmutableMap({ do_not_federate })),
);
map.set('id', null);
map.set('quoted_status_id', action.status.getIn(['quote', 'quoted_status'], null));
map.set('quoted_status_id', action.quoted_status_id);
// Mastodon-authored posts can be expected to have at most one automatic approval policy
map.set('quote_policy', action.status.getIn(['quote_approval', 'automatic', 0]) || 'nobody');