Use Tanstack Query status over isPending
This commit is contained in:
@@ -79,14 +79,14 @@ function ProfileScreenInner({route}: Props) {
|
|||||||
data: resolvedDid,
|
data: resolvedDid,
|
||||||
error: resolveError,
|
error: resolveError,
|
||||||
refetch: refetchDid,
|
refetch: refetchDid,
|
||||||
isLoading: isLoadingDid,
|
status: didStatus,
|
||||||
} = useResolveDidQuery(name)
|
} = useResolveDidQuery(name)
|
||||||
const {
|
const {
|
||||||
data: profile,
|
data: profile,
|
||||||
error: profileError,
|
error: profileError,
|
||||||
refetch: refetchProfile,
|
refetch: refetchProfile,
|
||||||
isLoading: isLoadingProfile,
|
|
||||||
isPlaceholderData: isPlaceholderProfile,
|
isPlaceholderData: isPlaceholderProfile,
|
||||||
|
status: profileStatus,
|
||||||
} = useProfileQuery({
|
} = useProfileQuery({
|
||||||
did: resolvedDid,
|
did: resolvedDid,
|
||||||
})
|
})
|
||||||
@@ -117,7 +117,7 @@ function ProfileScreenInner({route}: Props) {
|
|||||||
}, [queryClient, profile?.viewer?.blockedBy, resolvedDid])
|
}, [queryClient, profile?.viewer?.blockedBy, resolvedDid])
|
||||||
|
|
||||||
// Most pushes will happen here, since we will have only placeholder data
|
// Most pushes will happen here, since we will have only placeholder data
|
||||||
if (isLoadingDid || isLoadingProfile) {
|
if (didStatus === 'pending' || profileStatus === 'pending') {
|
||||||
return (
|
return (
|
||||||
<Layout.Content>
|
<Layout.Content>
|
||||||
<ProfileHeaderLoading />
|
<ProfileHeaderLoading />
|
||||||
|
|||||||
Reference in New Issue
Block a user