Merge pull request #2679 from bluesky-social/hailey/check-blocks-load-profile
clear cache when blocking/unblocking and whenever we get blocked, better invalidation logic for `useProfileQuery`
This commit is contained in:
commit
4058174678
5 changed files with 48 additions and 13 deletions
|
@ -27,12 +27,12 @@ export function Component({did}: {did: string}) {
|
|||
data: profile,
|
||||
error: profileError,
|
||||
refetch: refetchProfile,
|
||||
isFetching: isFetchingProfile,
|
||||
isLoading: isLoadingProfile,
|
||||
} = useProfileQuery({
|
||||
did: did,
|
||||
})
|
||||
|
||||
if (isFetchingProfile || !moderationOpts) {
|
||||
if (isLoadingProfile || !moderationOpts) {
|
||||
return (
|
||||
<CenteredView style={[pal.view, s.flex1]}>
|
||||
<ProfileHeader
|
||||
|
|
|
@ -9,6 +9,7 @@ import {sanitizeDisplayName} from 'lib/strings/display-names'
|
|||
import {sanitizeHandle} from 'lib/strings/handles'
|
||||
import {makeProfileLink} from 'lib/routes/links'
|
||||
import {useProfileQuery} from '#/state/queries/profile'
|
||||
import {STALE} from '#/state/queries'
|
||||
|
||||
export function UserInfoText({
|
||||
type = 'md',
|
||||
|
@ -29,7 +30,10 @@ export function UserInfoText({
|
|||
attr = attr || 'handle'
|
||||
failed = failed || 'user'
|
||||
|
||||
const {data: profile, isError} = useProfileQuery({did})
|
||||
const {data: profile, isError} = useProfileQuery({
|
||||
did,
|
||||
staleTime: STALE.INFINITY,
|
||||
})
|
||||
|
||||
let inner
|
||||
if (isError) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue