diff options
Diffstat (limited to 'src/view/com/post-thread')
-rw-r--r-- | src/view/com/post-thread/PostRepostedBy.tsx | 2 | ||||
-rw-r--r-- | src/view/com/post-thread/PostThreadFollowBtn.tsx | 5 | ||||
-rw-r--r-- | src/view/com/post-thread/PostThreadItem.tsx | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/view/com/post-thread/PostRepostedBy.tsx b/src/view/com/post-thread/PostRepostedBy.tsx index 2143bd9c2..c27e37f49 100644 --- a/src/view/com/post-thread/PostRepostedBy.tsx +++ b/src/view/com/post-thread/PostRepostedBy.tsx @@ -16,7 +16,7 @@ function renderItem({ item, index, }: { - item: ActorDefs.ProfileViewBasic + item: ActorDefs.ProfileView index: number }) { return ( diff --git a/src/view/com/post-thread/PostThreadFollowBtn.tsx b/src/view/com/post-thread/PostThreadFollowBtn.tsx index 9dc93916a..145e919f9 100644 --- a/src/view/com/post-thread/PostThreadFollowBtn.tsx +++ b/src/view/com/post-thread/PostThreadFollowBtn.tsx @@ -5,7 +5,7 @@ import {useLingui} from '@lingui/react' import {useNavigation} from '@react-navigation/native' import {logger} from '#/logger' -import {Shadow, useProfileShadow} from '#/state/cache/profile-shadow' +import {useProfileShadow} from '#/state/cache/profile-shadow' import { useProfileFollowMutationQueue, useProfileQuery, @@ -35,8 +35,7 @@ function PostThreadFollowBtnLoaded({ const navigation = useNavigation() const {_} = useLingui() const {gtMobile} = useBreakpoints() - const profile: Shadow<AppBskyActorDefs.ProfileViewBasic> = - useProfileShadow(profileUnshadowed) + const profile = useProfileShadow(profileUnshadowed) const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue( profile, 'PostThreadItem', diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 928ccd783..024629198 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 bsky from '#/types/bsky' export function PostThreadItem({ post, @@ -790,7 +791,10 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) { const control = Prompt.usePromptControl() const indexedAt = new Date(post.indexedAt) - const createdAt = AppBskyFeedPost.isRecord(post.record) + const createdAt = bsky.dangerousIsType<AppBskyFeedPost.Record>( + post.record, + AppBskyFeedPost.isRecord, + ) ? new Date(post.record.createdAt) : new Date(post.indexedAt) |