Fix “Delete & Redraft” as well as “Edit” unexpectedly reseting quote policy (#35808)

This commit is contained in:
Claire 2025-08-18 16:51:16 +02:00 committed by GitHub
parent f5754f2a36
commit c2fcf4183c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -512,6 +512,8 @@ export const composeReducer = (state = initialState, action) => {
map.set('sensitive', action.status.get('sensitive')); map.set('sensitive', action.status.get('sensitive'));
map.set('language', action.status.get('language')); map.set('language', action.status.get('language'));
map.set('id', null); map.set('id', 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');
if (action.status.get('spoiler_text').length > 0) { if (action.status.get('spoiler_text').length > 0) {
map.set('spoiler', true); map.set('spoiler', true);
@ -541,6 +543,8 @@ export const composeReducer = (state = initialState, action) => {
map.set('idempotencyKey', uuid()); map.set('idempotencyKey', uuid());
map.set('sensitive', action.status.get('sensitive')); map.set('sensitive', action.status.get('sensitive'));
map.set('language', action.status.get('language')); map.set('language', action.status.get('language'));
// 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');
if (action.spoiler_text.length > 0) { if (action.spoiler_text.length > 0) {
map.set('spoiler', true); map.set('spoiler', true);