Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

No need to await follows anymore, fix cold load search (#1918)

authored by

Eric Bailey and committed by
GitHub
9bcd00b8 fe1a7183

+4 -7
+4 -7
src/view/screens/Search/Search.tsx
··· 33 33 import {usePalette} from '#/lib/hooks/usePalette' 34 34 import {useTheme} from 'lib/ThemeContext' 35 35 import {useSession} from '#/state/session' 36 - import {useMyFollowsQuery} from '#/state/queries/my-follows' 37 36 import {useGetSuggestedFollowersByActor} from '#/state/queries/suggested-follows' 38 37 import {useSearchPostsQuery} from '#/state/queries/search-posts' 39 38 import {useActorAutocompleteFn} from '#/state/queries/actor-autocomplete' ··· 298 297 AppBskyActorDefs.ProfileViewBasic[] 299 298 >([]) 300 299 const search = useActorAutocompleteFn() 301 - // fuzzy search relies on followers 302 - const {isFetched: isFollowsFetched} = useMyFollowsQuery() 303 300 304 301 React.useEffect(() => { 305 302 async function getResults() { ··· 312 309 } 313 310 } 314 311 315 - if (query && isFollowsFetched) { 312 + if (query) { 316 313 getResults() 317 314 } else { 318 315 setResults([]) 319 316 setIsFetched(false) 320 317 } 321 - }, [query, isFollowsFetched, setDataUpdatedAt, search]) 318 + }, [query, setDataUpdatedAt, search]) 322 319 323 320 return isFetched ? ( 324 321 <> ··· 413 410 } 414 411 415 412 export function SearchScreenMobile( 416 - _props: NativeStackScreenProps<SearchTabNavigatorParams, 'Search'>, 413 + props: NativeStackScreenProps<SearchTabNavigatorParams, 'Search'>, 417 414 ) { 418 415 const theme = useTheme() 419 416 const textInput = React.useRef<TextInput>(null) ··· 431 428 undefined, 432 429 ) 433 430 const [isFetching, setIsFetching] = React.useState<boolean>(false) 434 - const [query, setQuery] = React.useState<string>('') 431 + const [query, setQuery] = React.useState<string>(props.route?.params?.q || '') 435 432 const [searchResults, setSearchResults] = React.useState< 436 433 AppBskyActorDefs.ProfileViewBasic[] 437 434 >([])