use asPredicate
This commit is contained in:
@@ -3,6 +3,7 @@ import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native'
|
|||||||
import {
|
import {
|
||||||
AppBskyFeedDefs,
|
AppBskyFeedDefs,
|
||||||
AppBskyFeedPost,
|
AppBskyFeedPost,
|
||||||
|
asPredicate,
|
||||||
AtUri,
|
AtUri,
|
||||||
ModerationDecision,
|
ModerationDecision,
|
||||||
RichText as RichTextAPI,
|
RichText as RichTextAPI,
|
||||||
@@ -53,7 +54,9 @@ export function Post({
|
|||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
const record = useMemo<AppBskyFeedPost.Record | undefined>(
|
const record = useMemo<AppBskyFeedPost.Record | undefined>(
|
||||||
() =>
|
() =>
|
||||||
AppBskyFeedPost.isValidRecord(post.record) ? post.record : undefined,
|
asPredicate(AppBskyFeedPost.validateRecord)(post.record)
|
||||||
|
? post.record
|
||||||
|
: undefined,
|
||||||
[post],
|
[post],
|
||||||
)
|
)
|
||||||
const postShadowed = usePostShadow(post)
|
const postShadowed = usePostShadow(post)
|
||||||
|
|||||||
Reference in New Issue
Block a user