diff options
Diffstat (limited to 'src/state/queries/post-thread.ts')
-rw-r--r-- | src/state/queries/post-thread.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/state/queries/post-thread.ts b/src/state/queries/post-thread.ts index 79350c119..b1cd626cf 100644 --- a/src/state/queries/post-thread.ts +++ b/src/state/queries/post-thread.ts @@ -18,6 +18,7 @@ import { findAllProfilesInQueryData as findAllProfilesInSearchQueryData, } from '#/state/queries/search-posts' import {useAgent} from '#/state/session' +import * as bsky from '#/types/bsky' import { findAllPostsInQueryData as findAllPostsInNotifsQueryData, findAllProfilesInQueryData as findAllProfilesInNotifsQueryData, @@ -332,8 +333,10 @@ function responseToThreadNodes( ): ThreadNode { if ( AppBskyFeedDefs.isThreadViewPost(node) && - AppBskyFeedPost.isRecord(node.post.record) && - AppBskyFeedPost.validateRecord(node.post.record).success + bsky.dangerousIsType<AppBskyFeedPost.Record>( + node.post.record, + AppBskyFeedPost.isRecord, + ) ) { const post = node.post // These should normally be present. They're missing only for @@ -364,7 +367,7 @@ function responseToThreadNodes( depth, isHighlightedPost: depth === 0, hasMore: - direction === 'down' && !node.replies?.length && !!node.replyCount, + direction === 'down' && !node.replies?.length && !!post.replyCount, isSelfThread: false, // populated `annotateSelfThread` hasMoreSelfThread: false, // populated in `annotateSelfThread` }, @@ -497,7 +500,7 @@ export function* findAllPostsInQueryData( export function* findAllProfilesInQueryData( queryClient: QueryClient, did: string, -): Generator<AppBskyActorDefs.ProfileView, void> { +): Generator<AppBskyActorDefs.ProfileViewBasic, void> { const queryDatas = queryClient.getQueriesData<PostThreadQueryData>({ queryKey: [RQKEY_ROOT], }) |