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