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
parent
bedb0c3fbd
commit
24bd3d6986
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue