Small fix to bday handling
This commit is contained in:
@@ -54,6 +54,8 @@ export function NoAccessScreen() {
|
|||||||
const {logoutCurrentAccount} = useSessionApi()
|
const {logoutCurrentAccount} = useSessionApi()
|
||||||
const createSupportLink = useCreateSupportLink()
|
const createSupportLink = useCreateSupportLink()
|
||||||
|
|
||||||
|
const aa = useAgeAssurance()
|
||||||
|
const isBlocked = aa.state.status === aa.Status.Blocked
|
||||||
const isAARegion = !!region
|
const isAARegion = !!region
|
||||||
const hasDeclaredAge = data?.declaredAge !== undefined
|
const hasDeclaredAge = data?.declaredAge !== undefined
|
||||||
const canUpdateBirthday =
|
const canUpdateBirthday =
|
||||||
@@ -79,7 +81,7 @@ export function NoAccessScreen() {
|
|||||||
const birthdateUpdateText = canUpdateBirthday ? (
|
const birthdateUpdateText = canUpdateBirthday ? (
|
||||||
<Text style={[textStyles]}>
|
<Text style={[textStyles]}>
|
||||||
<Trans>
|
<Trans>
|
||||||
If your birthdate is not accurate, you can update it by{' '}
|
If you believe your birthdate is incorrect, you can update it by{' '}
|
||||||
<SimpleInlineLinkText
|
<SimpleInlineLinkText
|
||||||
label={_(msg`Click here to update your birthdate`)}
|
label={_(msg`Click here to update your birthdate`)}
|
||||||
style={[textStyles]}
|
style={[textStyles]}
|
||||||
@@ -94,7 +96,7 @@ export function NoAccessScreen() {
|
|||||||
) : (
|
) : (
|
||||||
<Text style={[textStyles]}>
|
<Text style={[textStyles]}>
|
||||||
<Trans>
|
<Trans>
|
||||||
If you accidentally typed an incorrect birthdate, please{' '}
|
If you believe your birthdate is incorrect, please{' '}
|
||||||
<SimpleInlineLinkText
|
<SimpleInlineLinkText
|
||||||
to={createSupportLink({code: SupportCode.AA_BIRTHDATE})}
|
to={createSupportLink({code: SupportCode.AA_BIRTHDATE})}
|
||||||
label={_(msg`Click here to contact our support team`)}
|
label={_(msg`Click here to contact our support team`)}
|
||||||
@@ -145,7 +147,7 @@ export function NoAccessScreen() {
|
|||||||
</Trans>
|
</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{birthdateUpdateText}
|
{!isBlocked && birthdateUpdateText}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<AccessSection />
|
<AccessSection />
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {snoozeBirthdateUpdateAllowedForDid} from '#/state/birthdate'
|
|||||||
import {useAgent, useSession} from '#/state/session'
|
import {useAgent, useSession} from '#/state/session'
|
||||||
import * as debug from '#/ageAssurance/debug'
|
import * as debug from '#/ageAssurance/debug'
|
||||||
import {logger} from '#/ageAssurance/logger'
|
import {logger} from '#/ageAssurance/logger'
|
||||||
import {isLegacyBirthdateBug, isUserUnderMinimumAge} from '#/ageAssurance/util'
|
import {isLegacyBirthdateBug} from '#/ageAssurance/util'
|
||||||
import {IS_DEV} from '#/env'
|
import {IS_DEV} from '#/env'
|
||||||
import {device} from '#/storage'
|
import {device} from '#/storage'
|
||||||
|
|
||||||
@@ -334,11 +334,7 @@ export async function getOtherRequiredData({
|
|||||||
* If the user is under the minimum age, and the birthdate is not due to
|
* If the user is under the minimum age, and the birthdate is not due to
|
||||||
* the legacy bug, snooze further birthdate updates for this user.
|
* the legacy bug, snooze further birthdate updates for this user.
|
||||||
*/
|
*/
|
||||||
if (
|
if (data.birthdate && !isLegacyBirthdateBug(data.birthdate)) {
|
||||||
data.birthdate &&
|
|
||||||
isUserUnderMinimumAge(data.birthdate) &&
|
|
||||||
!isLegacyBirthdateBug(data.birthdate)
|
|
||||||
) {
|
|
||||||
snoozeBirthdateUpdateAllowedForDid(did!)
|
snoozeBirthdateUpdateAllowedForDid(did!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user