diff --git a/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx b/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx index 6157ab91e..10692249d 100644 --- a/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx +++ b/src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx @@ -325,7 +325,7 @@ export function AssemblyEmbed({ accessibilityRole="link" accessibilityLabel="Sign in to vote" accessibilityHint="Opens the assembly page to sign in and vote"> - + Sign in to vote @@ -459,7 +459,7 @@ export function AssemblyEmbed({ accessibilityRole="button" accessibilityLabel="Agree" accessibilityHint="Vote agree on this statement"> - + {voting ? '...' : 'Agree'} @@ -478,7 +478,7 @@ export function AssemblyEmbed({ accessibilityRole="button" accessibilityLabel="Disagree" accessibilityHint="Vote disagree on this statement"> - + {voting ? '...' : 'Disagree'} @@ -500,7 +500,7 @@ export function AssemblyEmbed({ {voting ? '...' : 'Pass / Unsure'} diff --git a/src/lib/react-query.tsx b/src/lib/react-query.tsx index ec657b6c4..b18d80592 100644 --- a/src/lib/react-query.tsx +++ b/src/lib/react-query.tsx @@ -1,7 +1,12 @@ import {useEffect, useRef, useState} from 'react' import {AppState, type AppStateStatus} from 'react-native' import {createAsyncStoragePersister} from '@tanstack/query-async-storage-persister' -import {focusManager, onlineManager, QueryClient} from '@tanstack/react-query' +import { + focusManager, + onlineManager, + type Query, + QueryClient, +} from '@tanstack/react-query' import { type PersistQueryClientOptions, PersistQueryClientProvider, @@ -17,7 +22,7 @@ import {IS_NATIVE, IS_WEB} from '#/env' declare global { interface Window { // eslint-disable-next-line @typescript-eslint/consistent-type-imports - __TANSTACK_QUERY_CLIENT__: import('@tanstack/query-core').QueryClient + __TANSTACK_QUERY_CLIENT__: import('@tanstack/react-query').QueryClient } } @@ -133,14 +138,15 @@ const createQueryClient = () => }, }) -const dehydrateOptions: PersistQueryClientProviderProps['persistOptions']['dehydrateOptions'] = - { - shouldDehydrateMutation: (_: any) => false, - shouldDehydrateQuery: query => { - const root = String(query.queryKey[0]) - return root === PERSISTED_QUERY_ROOT - }, - } +const dehydrateOptions: NonNullable< + PersistQueryClientProviderProps['persistOptions']['dehydrateOptions'] +> = { + shouldDehydrateMutation: (_: any) => false, + shouldDehydrateQuery: (query: Query) => { + const root = String(query.queryKey[0]) + return root === PERSISTED_QUERY_ROOT + }, +} export function QueryProvider({ children, diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index b8c2153f9..92163110c 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -1,5 +1,5 @@ import {AtUri} from '@atproto/api' -import psl from 'psl' +import * as psl from 'psl' import TLDs from 'tlds' import {BSKY_SERVICE} from '#/lib/constants' @@ -327,7 +327,7 @@ export function isPossiblyAUrl(str: string): boolean { export function splitApexDomain(hostname: string): [string, string] { const hostnamep = psl.parse(hostname) - if (hostnamep.error || !hostnamep.listed || !hostnamep.domain) { + if ('error' in hostnamep || !hostnamep.listed || !hostnamep.domain) { return ['', hostname] } return [ diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index c9d095a5a..287b5d746 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -14,6 +14,7 @@ import { type InfiniteData, keepPreviousData, type QueryClient, + type QueryKey, useInfiniteQuery, useMutation, useQuery, diff --git a/tsconfig.json b/tsconfig.json index 2f3d9354d..3f826e452 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,8 @@ "#/*": ["./src/*"], "crypto": ["./src/platform/crypto.ts"], "multiformats/cid": ["node_modules/multiformats/types/src/cid.d.ts"], - "multiformats/hashes/hasher": ["node_modules/multiformats/types/src/hashes/hasher.d.ts"] + "multiformats/hashes/hasher": ["node_modules/multiformats/types/src/hashes/hasher.d.ts"], + "psl": ["node_modules/psl/types/index.d.ts"] }, "plugins": [ {