Re-check on window focus

This commit is contained in:
Eric Bailey
2025-07-11 14:49:10 -05:00
parent ee796fe960
commit e575a13d91
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -130,6 +130,8 @@ export function useGetAndRegisterPushToken() {
}: { }: {
isAgeRestricted?: boolean isAgeRestricted?: boolean
} = {}) => { } = {}) => {
if (!isNative) return
/** /**
* This will also fire the listener added via `addPushTokenListener`. That * This will also fire the listener added via `addPushTokenListener`. That
* listener also handles registration. * listener also handles registration.
+3
View File
@@ -13,6 +13,7 @@ import {
type AgeAssuranceContextType, type AgeAssuranceContextType,
} from '#/state/age-assurance/types' } from '#/state/age-assurance/types'
import {useGeolocation} from '#/state/geolocation' import {useGeolocation} from '#/state/geolocation'
import {STALE} from '#/state/queries'
import {useAgent} from '#/state/session' import {useAgent} from '#/state/session'
const logger = Logger.create(Logger.Context.AgeAssurance) const logger = Logger.create(Logger.Context.AgeAssurance)
@@ -50,6 +51,8 @@ export function Provider({children}: {children: React.ReactNode}) {
*/ */
enabled: true, enabled: true,
queryKey: createAgeAssuranceQueryKey(agent.session?.did ?? 'never'), queryKey: createAgeAssuranceQueryKey(agent.session?.did ?? 'never'),
staleTime: STALE.MINUTES.ONE,
refetchOnWindowFocus: true,
async queryFn() { async queryFn() {
if (!agent.session) return null if (!agent.session) return null