diff options
author | Hailey <me@haileyok.com> | 2024-04-26 22:31:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-27 06:31:07 +0100 |
commit | 7eb1444f2c82cd25a77445b82178b7299e8452c7 (patch) | |
tree | c160dcafad17ec148f3d0e9b5b03cbf326255821 /src/view/com/post/Post.tsx | |
parent | ce85375c856549371e1e561e21bb5932baca8ea6 (diff) | |
download | voidsky-7eb1444f2c82cd25a77445b82178b7299e8452c7.tar.zst |
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>
Diffstat (limited to 'src/view/com/post/Post.tsx')
-rw-r--r-- | src/view/com/post/Post.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index b46586941..546eb2821 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -21,7 +21,7 @@ import {usePalette} from 'lib/hooks/usePalette' import {makeProfileLink} from 'lib/routes/links' import {countLines} from 'lib/strings/helpers' import {colors, s} from 'lib/styles' -import {RQKEY as RQKEY_URI} from 'state/queries/resolve-uri' +import {precacheProfile} from 'state/queries/profile' import {atoms as a} from '#/alf' import {ProfileHoverCard} from '#/components/ProfileHoverCard' import {RichText} from '#/components/RichText' @@ -135,8 +135,8 @@ function PostInner({ }, [setLimitLines]) const onBeforePress = React.useCallback(() => { - queryClient.setQueryData(RQKEY_URI(post.author.handle), post.author.did) - }, [queryClient, post.author.handle, post.author.did]) + precacheProfile(queryClient, post.author) + }, [queryClient, post.author]) return ( <Link @@ -148,9 +148,7 @@ function PostInner({ <View style={styles.layoutAvi}> <PreviewableUserAvatar size={52} - did={post.author.did} - handle={post.author.handle} - avatar={post.author.avatar} + profile={post.author} moderation={moderation.ui('avatar')} type={post.author.associated?.labeler ? 'labeler' : 'user'} /> |