From c8c308e31e63607280648e3e9f1f56a371adcd05 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 10 Nov 2023 15:34:25 -0800 Subject: Refactor feeds to use react-query (#1862) * Update to react-query v5 * Introduce post-feed react query * Add feed refresh behaviors * Only fetch feeds of visible pages * Implement polling for latest on feeds * Add moderation filtering to slices * Handle block errors * Update feed error messages * Remove old models * Replace simple-feed option with disable-tuner option * Add missing useMemo * Implement the mergefeed and fixes to polling * Correctly handle failed load more state * Improve error and empty state behaviors * Clearer naming --- src/view/com/post-thread/PostThreadItem.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/view/com/post-thread/PostThreadItem.tsx') diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index a8e0c0f93..0535cab53 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -69,15 +69,11 @@ export function PostThreadItem({ const postShadowed = usePostShadow(post, dataUpdatedAt) const richText = useMemo( () => - post && - AppBskyFeedPost.isRecord(post?.record) && - AppBskyFeedPost.validateRecord(post?.record).success - ? new RichTextAPI({ - text: post.record.text, - facets: post.record.facets, - }) - : undefined, - [post], + new RichTextAPI({ + text: record.text, + facets: record.facets, + }), + [record], ) const moderation = useMemo( () => -- cgit 1.4.1