Write chat declaration record in response to different events (#10216)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
DS Boyce
2026-04-20 13:39:12 -07:00
committed by GitHub
parent d58ff89441
commit 8c2e4c6fad
10 changed files with 298 additions and 125 deletions
+6
View File
@@ -4,6 +4,7 @@ import {useMutation, useQueryClient} from '@tanstack/react-query'
import {preferencesQueryKey} from '#/state/queries/preferences'
import {useAgent, useSession} from '#/state/session'
import {usePatchAgeAssuranceOtherRequiredData} from '#/ageAssurance'
import {isUnderAge, maybeRestrictChatSettings} from '#/ageAssurance/util'
import {IS_DEV} from '#/env'
import {account} from '#/storage'
@@ -63,6 +64,11 @@ export function useBirthdateMutation() {
await queryClient.invalidateQueries({
queryKey: preferencesQueryKey,
})
if (isUnderAge(birthDate.toISOString(), 18)) {
maybeRestrictChatSettings({agent})
}
/**
* Also patch the age assurance other required data with the new
* birthdate, which may change the user's age assurance access level.