adjustments
This commit is contained in:
@@ -29,20 +29,6 @@ export const profileBasicKey = (did: string) => ['profileBasic', did]
|
|||||||
export const profilesQueryKey = (handles: string[]) => ['profiles', handles]
|
export const profilesQueryKey = (handles: string[]) => ['profiles', handles]
|
||||||
|
|
||||||
export function useProfileQuery({did}: {did: string | undefined}) {
|
export function useProfileQuery({did}: {did: string | undefined}) {
|
||||||
// return useQuery({
|
|
||||||
// // WARNING
|
|
||||||
// // this staleTime is load-bearing
|
|
||||||
// // if you remove it, the UI infinite-loops
|
|
||||||
// // -prf
|
|
||||||
// staleTime,
|
|
||||||
// refetchOnWindowFocus: true,
|
|
||||||
// queryKey: RQKEY(did || ''),
|
|
||||||
// queryFn: async () => {
|
|
||||||
// const res = await getAgent().getProfile({actor: did || ''})
|
|
||||||
// return res.data
|
|
||||||
// },
|
|
||||||
// enabled: !!did,
|
|
||||||
// })
|
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
// TODO Figure out a good staleTime for this. We should refetch on every profile push, because we need to check for
|
// TODO Figure out a good staleTime for this. We should refetch on every profile push, because we need to check for
|
||||||
// blocks
|
// blocks
|
||||||
|
|||||||
@@ -130,8 +130,7 @@ export function precacheFeedPosts(
|
|||||||
handleEmbed(post.post.embed)
|
handleEmbed(post.post.embed)
|
||||||
|
|
||||||
// Cache parent author and embeds
|
// Cache parent author and embeds
|
||||||
if (AppBskyActorDefs.isProfileViewBasic(post.reply?.parent.author)) {
|
if (post.reply?.parent.author) {
|
||||||
console.log(post.reply?.parent.author)
|
|
||||||
precacheProfile(
|
precacheProfile(
|
||||||
queryClient,
|
queryClient,
|
||||||
post.reply.parent.author as AppBskyActorDefs.ProfileViewBasic,
|
post.reply.parent.author as AppBskyActorDefs.ProfileViewBasic,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import {sanitizeDisplayName} from 'lib/strings/display-names'
|
|||||||
import {sanitizeHandle} from 'lib/strings/handles'
|
import {sanitizeHandle} from 'lib/strings/handles'
|
||||||
import {makeProfileLink} from 'lib/routes/links'
|
import {makeProfileLink} from 'lib/routes/links'
|
||||||
import {useProfileQuery} from '#/state/queries/profile'
|
import {useProfileQuery} from '#/state/queries/profile'
|
||||||
import {STALE} from '#/state/queries'
|
|
||||||
|
|
||||||
export function UserInfoText({
|
export function UserInfoText({
|
||||||
type = 'md',
|
type = 'md',
|
||||||
@@ -32,7 +31,6 @@ export function UserInfoText({
|
|||||||
|
|
||||||
const {data: profile, isError} = useProfileQuery({
|
const {data: profile, isError} = useProfileQuery({
|
||||||
did,
|
did,
|
||||||
staleTime: STALE.INFINITY,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
let inner
|
let inner
|
||||||
|
|||||||
Reference in New Issue
Block a user