diff options
Diffstat (limited to 'src/state')
-rw-r--r-- | src/state/session/agent.ts | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/state/session/agent.ts b/src/state/session/agent.ts index 3de4cad26..972d33425 100644 --- a/src/state/session/agent.ts +++ b/src/state/session/agent.ts @@ -154,15 +154,18 @@ export async function createAgentAndCreateAccount( id: TID.nextStr(), }, ]) - await agent.api.com.atproto.repo.putRecord({ - repo: account.did, - collection: 'chat.bsky.actor.declaration', - rkey: 'self', - record: { - $type: 'chat.bsky.actor.declaration', - allowIncoming: getAge(birthDate) < 18 ? 'none' : 'following', - }, - }) + + if (getAge(birthDate) < 18) { + await agent.api.com.atproto.repo.putRecord({ + repo: account.did, + collection: 'chat.bsky.actor.declaration', + rkey: 'self', + record: { + $type: 'chat.bsky.actor.declaration', + allowIncoming: 'none', + }, + }) + } }) } catch (e: any) { logger.error(e, { |