···15import {networkRetry} from '#/lib/async/retry'
16import {PUBLIC_BSKY_SERVICE} from '#/lib/constants'
17import {getAge} from '#/lib/strings/time'
18-import {snoozeBirthdateUpdateAllowedForDid} from '#/state/birthdate'
00019import {useAgent, useSession} from '#/state/session'
20import * as debug from '#/ageAssurance/debug'
21import {logger} from '#/ageAssurance/logger'
···331 }
332333 /**
334- * If the user is under the minimum age, and the birthdate is not due to
335- * the legacy bug, snooze further birthdate updates for this user.
000336 */
337- if (data.birthdate && !isLegacyBirthdateBug(data.birthdate)) {
0000338 snoozeBirthdateUpdateAllowedForDid(did!)
339 }
340
···15import {networkRetry} from '#/lib/async/retry'
16import {PUBLIC_BSKY_SERVICE} from '#/lib/constants'
17import {getAge} from '#/lib/strings/time'
18+import {
19+ hasSnoozedBirthdateUpdateForDid,
20+ snoozeBirthdateUpdateAllowedForDid,
21+} from '#/state/birthdate'
22import {useAgent, useSession} from '#/state/session'
23import * as debug from '#/ageAssurance/debug'
24import {logger} from '#/ageAssurance/logger'
···334 }
335336 /**
337+ * If the user is under the minimum age, and the birthdate is not due to the
338+ * legacy bug, AND we've not already snoozed their birthdate update, snooze
339+ * further birthdate updates for this user.
340+ *
341+ * This is basically a migration step for this initial rollout.
342 */
343+ if (
344+ data.birthdate &&
345+ !isLegacyBirthdateBug(data.birthdate) &&
346+ !hasSnoozedBirthdateUpdateForDid(did!)
347+ ) {
348 snoozeBirthdateUpdateAllowedForDid(did!)
349 }
350
+9
src/state/birthdate.ts
···21}
2223/**
00000000024 * Returns whether a birthdate update is currently allowed, based on the
25 * last update timestamp stored locally.
26 */
···21}
2223/**
24+ * Checks if we've already snoozed bday updates. In some cases, if one is
25+ * present, we don't need to set another, such as in AA when reading initial
26+ * data on load.
27+ */
28+export function hasSnoozedBirthdateUpdateForDid(did: string) {
29+ return !!account.get([did, 'birthdateLastUpdatedAt'])
30+}
31+32+/**
33 * Returns whether a birthdate update is currently allowed, based on the
34 * last update timestamp stored locally.
35 */