It's memo, can validate

This commit is contained in:
Eric Bailey
2025-01-08 15:29:22 -06:00
parent d05a11bb98
commit c488e92bcc
+1 -7
View File
@@ -28,7 +28,6 @@ import {atoms as a} from '#/alf'
import {ProfileHoverCard} from '#/components/ProfileHoverCard' import {ProfileHoverCard} from '#/components/ProfileHoverCard'
import {RichText} from '#/components/RichText' import {RichText} from '#/components/RichText'
import {SubtleWebHover} from '#/components/SubtleWebHover' import {SubtleWebHover} from '#/components/SubtleWebHover'
import * as atp from '#/types/atproto'
import {ContentHider} from '../../../components/moderation/ContentHider' import {ContentHider} from '../../../components/moderation/ContentHider'
import {LabelsOnMyPost} from '../../../components/moderation/LabelsOnMe' import {LabelsOnMyPost} from '../../../components/moderation/LabelsOnMe'
import {PostAlerts} from '../../../components/moderation/PostAlerts' import {PostAlerts} from '../../../components/moderation/PostAlerts'
@@ -54,12 +53,7 @@ export function Post({
const moderationOpts = useModerationOpts() const moderationOpts = useModerationOpts()
const record = useMemo<AppBskyFeedPost.Record | undefined>( const record = useMemo<AppBskyFeedPost.Record | undefined>(
() => () =>
atp.dangerousIsType<AppBskyFeedPost.Record>( AppBskyFeedPost.isValidRecord(post.record) ? post.record : undefined,
post.record,
AppBskyFeedPost.isRecord,
)
? post.record
: undefined,
[post], [post],
) )
const postShadowed = usePostShadow(post) const postShadowed = usePostShadow(post)