flip the legacy view type imports to the generated lexicons
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import {useCallback, useState} from 'react'
|
||||
import {type AppBskyFeedDefs, AppBskyFeedPost} from '@atproto/api'
|
||||
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
||||
import {moderatePost} from '#/lib/moderation/subjects'
|
||||
@@ -22,9 +22,9 @@ function renderItem({
|
||||
index,
|
||||
}: {
|
||||
item: {
|
||||
post: AppBskyFeedDefs.PostView
|
||||
post: app.bsky.feed.defs.PostView
|
||||
moderation: ModerationDecision
|
||||
record: AppBskyFeedPost.Record
|
||||
record: app.bsky.feed.post.Main
|
||||
}
|
||||
index: number
|
||||
}) {
|
||||
@@ -32,9 +32,9 @@ function renderItem({
|
||||
}
|
||||
|
||||
function keyExtractor(item: {
|
||||
post: AppBskyFeedDefs.PostView
|
||||
post: app.bsky.feed.defs.PostView
|
||||
moderation: ModerationDecision
|
||||
record: AppBskyFeedPost.Record
|
||||
record: app.bsky.feed.post.Main
|
||||
}) {
|
||||
return item.post.uri
|
||||
}
|
||||
@@ -69,10 +69,7 @@ export function PostQuotes({uri}: {uri: string}) {
|
||||
.flatMap(page =>
|
||||
page.posts.map(post => {
|
||||
if (
|
||||
!bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
||||
post.record,
|
||||
AppBskyFeedPost.isRecord,
|
||||
) ||
|
||||
!bsky.isType(app.bsky.feed.post, post.record) ||
|
||||
!moderationOpts
|
||||
) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user