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>
zio/stable
Hailey 2024-04-12 07:49:09 -07:00 committed by GitHub
parent bedb0c3fbd
commit 24bd3d6986
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -1,10 +1,10 @@
import {QueryClient, QueryKey, InfiniteData} from '@tanstack/react-query'
import { import {
AppBskyEmbedRecord, AppBskyEmbedRecord,
AppBskyEmbedRecordWithMedia, AppBskyEmbedRecordWithMedia,
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedPost, AppBskyFeedPost,
} from '@atproto/api' } from '@atproto/api'
import {InfiniteData, QueryClient, QueryKey} from '@tanstack/react-query'
export function truncateAndInvalidate<T = any>( export function truncateAndInvalidate<T = any>(
queryClient: QueryClient, queryClient: QueryClient,
@ -54,5 +54,9 @@ export function embedViewRecordToPostView(
indexedAt: v.indexedAt, indexedAt: v.indexedAt,
labels: v.labels, labels: v.labels,
embed: v.embeds?.[0], 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,
} }
} }