[Glitch] Fix “Delete and Redraft” on a non-quote being treated as a quote post in some cases

Port 1ae3b4672b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-12-05 16:17:48 +01:00
parent 7f1862b67e
commit 691f4e3210

View File

@@ -647,7 +647,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']));
map.set('quoted_status_id', action.status.getIn(['quote', 'quoted_status'], null));
// 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');
@@ -690,7 +690,7 @@ export const composeReducer = (state = initialState, action) => {
map.set('idempotencyKey', uuid());
map.set('sensitive', action.status.get('sensitive'));
map.set('language', action.status.get('language'));
map.set('quoted_status_id', action.status.getIn(['quote', 'quoted_status']));
map.set('quoted_status_id', action.status.getIn(['quote', 'quoted_status'], null));
// 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');