Bluesky app fork with some witchin' additions 💫

Expose QueryClient for TanStack Query DevTools browser extension (#9678)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

authored by samuel.fm

Claude Opus 4.5 and committed by
GitHub
61c91911 9aa360d3

+13 -2
+13 -2
src/lib/react-query.tsx
··· 1 - import {useRef, useState} from 'react' 1 + import {useEffect, useRef, useState} from 'react' 2 2 import {AppState, type AppStateStatus} from 'react-native' 3 3 import AsyncStorage from '@react-native-async-storage/async-storage' 4 4 import {createAsyncStoragePersister} from '@tanstack/query-async-storage-persister' ··· 9 9 } from '@tanstack/react-query-persist-client' 10 10 import type React from 'react' 11 11 12 - import {isNative} from '#/platform/detection' 12 + import {isNative, isWeb} from '#/platform/detection' 13 13 import {listenNetworkConfirmed, listenNetworkLost} from '#/state/events' 14 + 15 + declare global { 16 + interface Window { 17 + __TANSTACK_QUERY_CLIENT__: import('@tanstack/query-core').QueryClient 18 + } 19 + } 14 20 15 21 // any query keys in this array will be persisted to AsyncStorage 16 22 export const labelersDetailedInfoQueryKeyRoot = 'labelers-detailed-info' ··· 180 186 dehydrateOptions, 181 187 } 182 188 }) 189 + useEffect(() => { 190 + if (isWeb) { 191 + window.__TANSTACK_QUERY_CLIENT__ = queryClient 192 + } 193 + }, [queryClient]) 183 194 return ( 184 195 <PersistQueryClientProvider 185 196 client={queryClient}