Skip to content

Commit

Permalink
add likeCount etal. to embedViewRecordToPostView (#3500)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
haileyok and gaearon authored Apr 12, 2024
1 parent bedb0c3 commit 24bd3d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/state/queries/util.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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,
}
}

0 comments on commit 24bd3d6

Please sign in to comment.