Bluesky app fork with some witchin' additions 💫

Fix: fetch follows on desktop search for typeahead (#1660)

authored by

Paul Frazee and committed by
GitHub
d68b4ca8 60c0db03

+10 -2
+3 -2
src/state/models/cache/my-follows.ts
··· 5 5 moderateProfile, 6 6 } from '@atproto/api' 7 7 import {RootStoreModel} from '../root-store' 8 + import {bundleAsync} from 'lib/async/bundle' 8 9 9 10 const MAX_SYNC_PAGES = 10 10 11 const SYNC_TTL = 60e3 * 10 // 10 minutes ··· 56 57 * Syncs a subset of the user's follows 57 58 * for performance reasons, caps out at 1000 follows 58 59 */ 59 - async syncIfNeeded() { 60 + syncIfNeeded = bundleAsync(async () => { 60 61 if (this.lastSync > Date.now() - SYNC_TTL) { 61 62 return 62 63 } ··· 81 82 } 82 83 83 84 this.lastSync = Date.now() 84 - } 85 + }) 85 86 86 87 getFollowState(did: string): FollowState { 87 88 if (typeof this.byDid[did] === 'undefined') {
+7
src/view/shell/desktop/Search.tsx
··· 22 22 ) 23 23 const navigation = useNavigation<NavigationProp>() 24 24 25 + // initial setup 26 + React.useEffect(() => { 27 + if (store.me.did) { 28 + autocompleteView.setup() 29 + } 30 + }, [autocompleteView, store.me.did]) 31 + 25 32 const onChangeQuery = React.useCallback( 26 33 (text: string) => { 27 34 setQuery(text)