Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Move query augmentation to lower component (#2748)

authored by

Samuel Newman and committed by
GitHub
6ad58635 fca00d20

+9 -7
+9 -7
src/view/screens/Search/Search.tsx
··· 190 190 191 191 function SearchScreenPostResults({query}: {query: string}) { 192 192 const {_} = useLingui() 193 + const {currentAccount} = useSession() 193 194 const [isPTR, setIsPTR] = React.useState(false) 195 + 196 + const augmentedQuery = React.useMemo(() => { 197 + return augmentSearchQuery(query || '', {did: currentAccount?.did}) 198 + }, [query, currentAccount]) 199 + 194 200 const { 195 201 isFetched, 196 202 data: results, ··· 200 206 fetchNextPage, 201 207 isFetchingNextPage, 202 208 hasNextPage, 203 - } = useSearchPostsQuery({query}) 209 + } = useSearchPostsQuery({query: augmentedQuery}) 204 210 205 211 const onPullToRefresh = React.useCallback(async () => { 206 212 setIsPTR(true) ··· 319 325 const pal = usePalette('default') 320 326 const setMinimalShellMode = useSetMinimalShellMode() 321 327 const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled() 322 - const {hasSession, currentAccount} = useSession() 328 + const {hasSession} = useSession() 323 329 const {isDesktop} = useWebMediaQueries() 324 - 325 - const augmentedQuery = React.useMemo(() => { 326 - return augmentSearchQuery(query || '', {did: currentAccount?.did}) 327 - }, [query, currentAccount]) 328 330 329 331 const onPageSelected = React.useCallback( 330 332 (index: number) => { ··· 347 349 )} 348 350 initialPage={0}> 349 351 <View> 350 - <SearchScreenPostResults query={augmentedQuery} /> 352 + <SearchScreenPostResults query={query} /> 351 353 </View> 352 354 <View> 353 355 <SearchScreenUserResults query={query} />