diff options
author | Hailey <me@haileyok.com> | 2024-06-24 13:37:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 21:37:08 +0100 |
commit | e0ac7d5bdcb096d6c23658c34da04bfa19579e4f (patch) | |
tree | 5169dc94ffbefcd52304ff45046558d7b932a429 /src/screens/StarterPack/Wizard/StepProfiles.tsx | |
parent | f64245c1fb0b590edf1959ea0f30ec3bee507ad1 (diff) | |
download | voidsky-e0ac7d5bdcb096d6c23658c34da04bfa19579e4f.tar.zst |
handle each possible loading state (#4617)
Diffstat (limited to 'src/screens/StarterPack/Wizard/StepProfiles.tsx')
-rw-r--r-- | src/screens/StarterPack/Wizard/StepProfiles.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/screens/StarterPack/Wizard/StepProfiles.tsx b/src/screens/StarterPack/Wizard/StepProfiles.tsx index f21b01d40..33caa12f2 100644 --- a/src/screens/StarterPack/Wizard/StepProfiles.tsx +++ b/src/screens/StarterPack/Wizard/StepProfiles.tsx @@ -31,14 +31,20 @@ export function StepProfiles({ const [query, setQuery] = useState('') const {screenReaderEnabled} = useA11y() - const {data: topPages, fetchNextPage} = useActorSearchPaginated({ + const { + data: topPages, + fetchNextPage, + isLoading: isLoadingTopPages, + } = useActorSearchPaginated({ query: encodeURIComponent('*'), }) const topFollowers = topPages?.pages.flatMap(p => p.actors) - const {data: results, isLoading: isLoadingResults} = + const {data: results, isFetching: isFetchingResults} = useActorAutocompleteQuery(query, true, 12) + const isLoading = isLoadingTopPages || isFetchingResults + const renderItem = ({ item, }: ListRenderItemInfo<AppBskyActorDefs.ProfileViewBasic>) => { @@ -80,7 +86,7 @@ export function StepProfiles({ onEndReachedThreshold={isNative ? 2 : 0.25} ListEmptyComponent={ <View style={[a.flex_1, a.align_center, a.mt_lg, a.px_lg]}> - {isLoadingResults ? ( + {isLoading ? ( <Loader size="lg" /> ) : ( <Text |