From 24bd3d6986a8080a34836b34ee1dbd88357d1cb5 Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 12 Apr 2024 07:49:09 -0700 Subject: 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 --- src/state/queries/util.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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( 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, } } -- cgit 1.4.1