Re-check on window focus
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user