mirror of
https://github.com/mastodon/mastodon.git
synced 2026-02-21 12:38:29 +00:00
Fix delete & redraft of pending posts (#37839)
This commit is contained in:
parent
83182f9e13
commit
ab9aa25cd3
|
|
@ -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 }));
|
||||
|
|
|
|||
|
|
@ -532,7 +532,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');
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class REST::BaseQuoteSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def quoted_status
|
||||
object.quoted_status if object.accepted? && object.quoted_status.present? && !object.quoted_status&.reblog? && status_filter.filter_state_for_quote != 'unauthorized'
|
||||
object.quoted_status if (object.accepted? || instance_options[:source_requested]) && object.quoted_status.present? && !object.quoted_status&.reblog? && status_filter.filter_state_for_quote != 'unauthorized'
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user