remove precacheThreadPostProfiles (#3729)

* remove `precacheThreadPostProfiles`

* add `displayName` to `PreviewableUserAvatar`

* memo

* use `precacheProfile`

* pass `profile` directly to `PreviewableUserAvatar`

* update the `UserAvatar`'s props

* remove feed cache

* one more spot

* rm unused queryClient

* Don't call fn unnecessarily

* Preload for display name too

* try notification item

* add to feeditem

* and finally, precache for post threads

* timestamp

* Fix

* onBeforePress

---------

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
Hailey
2024-04-26 22:31:07 -07:00
committed by GitHub
parent ce85375c85
commit 7eb1444f2c
17 changed files with 119 additions and 168 deletions
-4
View File
@@ -12,7 +12,6 @@ import {
QueryClient,
QueryKey,
useInfiniteQuery,
useQueryClient,
} from '@tanstack/react-query'
import {HomeFeedAPI} from '#/lib/api/feed/home'
@@ -33,7 +32,6 @@ import {BSKY_FEED_OWNER_DIDS} from 'lib/constants'
import {KnownError} from '#/view/com/posts/FeedErrorMessage'
import {useFeedTuners} from '../preferences/feed-tuners'
import {useModerationOpts} from './preferences'
import {precacheFeedPostProfiles} from './profile'
import {embedViewRecordToPostView, getEmbeddedPost} from './util'
type ActorDid = string
@@ -102,7 +100,6 @@ export function usePostFeedQuery(
params?: FeedParams,
opts?: {enabled?: boolean; ignoreFilterFor?: string},
) {
const queryClient = useQueryClient()
const feedTuners = useFeedTuners(feedDesc)
const moderationOpts = useModerationOpts()
const {getAgent} = useAgent()
@@ -151,7 +148,6 @@ export function usePostFeedQuery(
try {
const res = await api.fetch({cursor, limit: PAGE_SIZE})
precacheFeedPostProfiles(queryClient, res.feed)
/*
* If this is a public view, we need to check if posts fail moderation.