From 44cb25d3a18f9614395e092d9683d04956f18d4a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 7 Jan 2025 10:40:40 -0600 Subject: [PATCH] Use dangerous util --- src/view/com/post-thread/PostThreadItem.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index c68421b634..d88ec66880 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -58,6 +58,7 @@ import {RichText} from '#/components/RichText' import {SubtleWebHover} from '#/components/SubtleWebHover' import {Text} from '#/components/Typography' import {WhoCanReply} from '#/components/WhoCanReply' +import * as atp from '#/types/atproto' export function PostThreadItem({ post, @@ -785,7 +786,10 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) { const control = Prompt.usePromptControl() const indexedAt = new Date(post.indexedAt) - const createdAt = AppBskyFeedPost.isValidRecord(post.record) + const createdAt = atp.dangerousIsType( + post.record, + AppBskyFeedPost.isRecord, + ) ? new Date(post.record.createdAt) : new Date(post.indexedAt)