[SDK] Use finalised package (#11398)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {createContext, useCallback, useContext, useEffect, useMemo} from 'react'
|
||||
import * as AgeRange from 'expo-age-range'
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {getPreferences} from '@bsky.app/sdk'
|
||||
import {getPreferences} from '@bsky/sdk'
|
||||
import {createAsyncStoragePersister} from '@tanstack/query-async-storage-persister'
|
||||
import {focusManager, QueryClient, useQuery} from '@tanstack/react-query'
|
||||
import {persistQueryClient} from '@tanstack/react-query-persist-client'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {useEffect, useMemo, useState} from 'react'
|
||||
import type * as AgeRange from 'expo-age-range'
|
||||
import {computeAgeAssuranceRegionAccess} from '@bsky.app/sdk/utils'
|
||||
import {computeAgeAssuranceRegionAccess} from '@bsky/sdk/utils'
|
||||
|
||||
import {getAge} from '#/lib/strings/time'
|
||||
import {useSession} from '#/state/session'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type * as AgeRange from 'expo-age-range'
|
||||
import {type computeAgeAssuranceRegionAccess} from '@bsky.app/sdk/utils'
|
||||
import {type computeAgeAssuranceRegionAccess} from '@bsky/sdk/utils'
|
||||
|
||||
import {logger} from '#/ageAssurance/logger'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {useCallback} from 'react'
|
||||
import {computeAgeAssuranceRegionAccess} from '@bsky.app/sdk/utils'
|
||||
import {computeAgeAssuranceRegionAccess} from '@bsky/sdk/utils'
|
||||
|
||||
import {useAgeAssuranceServerDataContext} from '#/ageAssurance/data'
|
||||
import {logger} from '#/ageAssurance/logger'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {useMemo} from 'react'
|
||||
import type * as AgeRange from 'expo-age-range'
|
||||
import {type ModerationPrefs} from '@bsky.app/sdk/moderation'
|
||||
import {type ModerationPrefs} from '@bsky/sdk/moderation'
|
||||
import {
|
||||
computeAgeAssuranceRegionAccess,
|
||||
getAgeAssuranceRegionConfig,
|
||||
} from '@bsky.app/sdk/utils'
|
||||
} from '@bsky/sdk/utils'
|
||||
|
||||
import {getAge} from '#/lib/strings/time'
|
||||
import {regionName} from '#/locale/helpers'
|
||||
@@ -45,28 +45,10 @@ export function getAgeAssuranceRegionConfigForGeolocation(
|
||||
config: app.bsky.ageassurance.defs.Config,
|
||||
geolocation: Geolocation,
|
||||
): app.bsky.ageassurance.defs.ConfigRegion | undefined {
|
||||
/*
|
||||
* The SDK's region matcher takes no `platform` filter, so platform scoping
|
||||
* is applied here: regions restricted to other platforms are dropped before
|
||||
* matching. Once the SDK accepts a platform, this whole function body
|
||||
* collapses to:
|
||||
*
|
||||
* return getAgeAssuranceRegionConfig(config, {
|
||||
* countryCode: geolocation.countryCode ?? '',
|
||||
* regionCode: geolocation.regionCode,
|
||||
* platform: AGE_ASSURANCE_PLATFORM,
|
||||
* })
|
||||
*/
|
||||
const scoped: app.bsky.ageassurance.defs.Config = {
|
||||
...config,
|
||||
regions: config.regions.filter(
|
||||
region =>
|
||||
!region.platforms || region.platforms.includes(AGE_ASSURANCE_PLATFORM),
|
||||
),
|
||||
}
|
||||
return getAgeAssuranceRegionConfig(scoped, {
|
||||
return getAgeAssuranceRegionConfig(config, {
|
||||
countryCode: geolocation.countryCode ?? '',
|
||||
regionCode: geolocation.regionCode,
|
||||
platform: AGE_ASSURANCE_PLATFORM,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user