Skip to content

Commit

Permalink
Always refetch profile in Name and Avatar component
Browse files Browse the repository at this point in the history
  • Loading branch information
samchuk-vlad committed Jun 11, 2024
1 parent b381cc0 commit 46a0468
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/AddressAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const AddressAvatar = forwardRef<HTMLDivElement, AddressAvatarProps>(
const [isAvatarError, setIsAvatarError] = useState(false)
const onImageError = useCallback(() => setIsAvatarError(true), [])

const { data: profile, isLoading } = getProfileQuery.useQuery(address)
const { data: profile, isLoading } = getProfileQuery.useQuery(address, {
refetchOnMount: 'always',
})

const profileSource = profile?.profileSpace?.content?.profileSource
const subsocialProfileImage = profile?.profileSpace?.content?.image
Expand Down
2 changes: 1 addition & 1 deletion src/components/Name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ LinkOrText.displayName = 'LinkOrText'

export function useName(address: string) {
const { data: profile, isLoading: isLoadingProfile } =
getProfileQuery.useQuery(address)
getProfileQuery.useQuery(address, { refetchOnMount: 'always' })
const textColor = useRandomColor(address)

let name = generateRandomName(address)
Expand Down

0 comments on commit 46a0468

Please sign in to comment.