mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 19:21:36 +02:00
Fix delete & redraft of pending posts (#37839)
This commit is contained in:
@@ -109,7 +109,7 @@ export function fetchStatusFail(id, error, skipLoading, parentQuotePostId) {
|
||||
};
|
||||
}
|
||||
|
||||
export function redraft(status, raw_text) {
|
||||
export function redraft(status, raw_text, 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) {
|
||||
type: REDRAFT,
|
||||
status,
|
||||
raw_text,
|
||||
quoted_status_id,
|
||||
maxOptions,
|
||||
});
|
||||
};
|
||||
@@ -169,7 +170,7 @@ export function deleteStatus(id, withRedraft = false) {
|
||||
dispatch(importFetchedAccount(response.data.account));
|
||||
|
||||
if (withRedraft) {
|
||||
dispatch(redraft(status, response.data.text));
|
||||
dispatch(redraft(status, response.data.text, response.data.quote?.quoted_status?.id));
|
||||
ensureComposeIsVisible(getState);
|
||||
} else {
|
||||
dispatch(showAlert({ message: messages.deleteSuccess }));
|
||||
|
||||
@@ -530,7 +530,7 @@ export const composeReducer = (state = initialState, action) => {
|
||||
map.set('sensitive', action.status.get('sensitive'));
|
||||
map.set('language', action.status.get('language'));
|
||||
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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user