diff options
author | Hailey <me@haileyok.com> | 2024-04-12 07:49:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 15:49:09 +0100 |
commit | 24bd3d6986a8080a34836b34ee1dbd88357d1cb5 (patch) | |
tree | eb93e8bf789bf9cb751246e4fa5589bd06ca9a29 /src | |
parent | bedb0c3fbd65b6520c97f22c99f10bb535a177bc (diff) | |
download | voidsky-24bd3d6986a8080a34836b34ee1dbd88357d1cb5.tar.zst |
add `likeCount` etal. to `embedViewRecordToPostView` (#3500)
* fix qt jumps Revert "don't show loading placeholder if we don't need it" This reverts commit 406f801f217b2733fdd82732c0af74186fc47464. don't show loading placeholder if we don't need it add `likeCount` etal. to `embedViewRecordToPostView` * lint * Revert the shimmer change --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/state/queries/util.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/state/queries/util.ts b/src/state/queries/util.ts index 54752b332..94d6c9df7 100644 --- a/src/state/queries/util.ts +++ b/src/state/queries/util.ts @@ -1,10 +1,10 @@ -import {QueryClient, QueryKey, InfiniteData} from '@tanstack/react-query' import { AppBskyEmbedRecord, AppBskyEmbedRecordWithMedia, AppBskyFeedDefs, AppBskyFeedPost, } from '@atproto/api' +import {InfiniteData, QueryClient, QueryKey} from '@tanstack/react-query' export function truncateAndInvalidate<T = any>( queryClient: QueryClient, @@ -54,5 +54,9 @@ export function embedViewRecordToPostView( indexedAt: v.indexedAt, labels: v.labels, embed: v.embeds?.[0], + // TODO we can remove the `as` once we update @atproto/api + likeCount: v.likeCount as number | undefined, + replyCount: v.replyCount as number | undefined, + repostCount: v.repostCount as number | undefined, } } |