Merge branch 'group-quote-fix' into 'develop'

Groups: set composer visibilty when quoting a group post

See merge request soapbox-pub/soapbox!2454
This commit is contained in:
Chewbacca 2023-04-19 15:54:44 +00:00
commit 7675b18e52

View file

@ -349,6 +349,15 @@ export default function compose(state = initialState, action: AnyAction) {
map.set('content_type', defaultCompose.content_type);
map.set('spoiler', false);
map.set('spoiler_text', '');
if (action.status.visibility === 'group') {
if (action.status.group?.group_visibility === 'everyone') {
map.set('privacy', privacyPreference('public', defaultCompose.privacy));
} else if (action.status.group?.group_visibility === 'members_only') {
map.set('group_id', action.status.getIn(['group', 'id']) || action.status.get('group'));
map.set('privacy', 'group');
}
}
}));
case COMPOSE_SUBMIT_REQUEST:
return updateCompose(state, action.id, compose => compose.set('is_submitting', true));