From 764e84557d8eebb9371780a85a51f08723ab2057 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 5 Jun 2026 16:43:07 +0300 Subject: [PATCH] align group invite settings with eligibility logic The settings screen showed unset allowGroupInvites as "following", but canBeAddedToGroup falls back to the general DM preference (allowIncoming) when unset. Mirror that in the radio display, and on save fall back to allowIncoming (then "following") and always write allowGroupInvites (previously it was omitted when unset). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/screens/Messages/Settings.tsx | 7 ++++++- src/state/queries/messages/actor-declaration.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/screens/Messages/Settings.tsx b/src/screens/Messages/Settings.tsx index f49311b0da..f392d1c65c 100644 --- a/src/screens/Messages/Settings.tsx +++ b/src/screens/Messages/Settings.tsx @@ -201,7 +201,12 @@ export function MessagesSettingsScreenInner({}: Props) { type="radio" values={[ (profile?.associated?.chat - ?.allowGroupInvites as AllowIncoming) ?? 'following', + ?.allowGroupInvites as AllowIncoming) ?? + // when unset, group invites follow the general DM + // preference (see canBeAddedToGroup) + (profile?.associated?.chat + ?.allowIncoming as AllowIncoming) ?? + 'following', ]} onChange={onSelectGroupInvitesFrom}> diff --git a/src/state/queries/messages/actor-declaration.ts b/src/state/queries/messages/actor-declaration.ts index 53b493ab6a..7261f96eb7 100644 --- a/src/state/queries/messages/actor-declaration.ts +++ b/src/state/queries/messages/actor-declaration.ts @@ -35,7 +35,11 @@ export function useUpdateActorDeclaration({ current?.associated?.chat?.allowIncoming ?? 'following' const allowGroupInvites = - update.allowGroupInvites ?? current?.associated?.chat?.allowGroupInvites + update.allowGroupInvites ?? + current?.associated?.chat?.allowGroupInvites ?? + // when unset, group invites follow the general DM preference + // (see canBeAddedToGroup), so mirror that when persisting + allowIncoming const result = await agent.com.atproto.repo.putRecord({ repo: currentAccount.did, collection: 'chat.bsky.actor.declaration', @@ -43,7 +47,7 @@ export function useUpdateActorDeclaration({ record: { $type: 'chat.bsky.actor.declaration', allowIncoming, - ...(allowGroupInvites && {allowGroupInvites}), + allowGroupInvites, }, }) return result