[Glitch] Fix delete & redraft of pending posts
Port ab9aa25cd37f65edbb96dfd20d9a6c21b5b46a1f to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
c0fe6f8600
commit
00f16a1863
@ -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) => {
|
return (dispatch, getState) => {
|
||||||
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
|
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
|
||||||
|
|
||||||
@ -117,6 +117,7 @@ export function redraft(status, raw_text, content_type) {
|
|||||||
type: REDRAFT,
|
type: REDRAFT,
|
||||||
status,
|
status,
|
||||||
raw_text,
|
raw_text,
|
||||||
|
quoted_status_id,
|
||||||
content_type,
|
content_type,
|
||||||
maxOptions,
|
maxOptions,
|
||||||
});
|
});
|
||||||
@ -135,7 +136,7 @@ export const editStatus = (id) => (dispatch, getState) => {
|
|||||||
api().get(`/api/v1/statuses/${id}/source`).then(response => {
|
api().get(`/api/v1/statuses/${id}/source`).then(response => {
|
||||||
dispatch(fetchStatusSourceSuccess());
|
dispatch(fetchStatusSourceSuccess());
|
||||||
ensureComposeIsVisible(getState);
|
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 => {
|
}).catch(error => {
|
||||||
dispatch(fetchStatusSourceFail(error));
|
dispatch(fetchStatusSourceFail(error));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -648,7 +648,7 @@ export const composeReducer = (state = initialState, action) => {
|
|||||||
map => map.merge(new ImmutableMap({ do_not_federate })),
|
map => map.merge(new ImmutableMap({ do_not_federate })),
|
||||||
);
|
);
|
||||||
map.set('id', null);
|
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
|
// 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');
|
map.set('quote_policy', action.status.getIn(['quote_approval', 'automatic', 0]) || 'nobody');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user