From 6bea2a02ab46611c993d2fdff55f467cb3ee8c31 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot <> Date: Mon, 6 Nov 2023 13:41:56 -0800 Subject: [PATCH] [fix] Regression in marking posts read on scroll --- src/components/Feed/components/MainFeed.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Feed/components/MainFeed.tsx b/src/components/Feed/components/MainFeed.tsx index fbd20a5c..07480476 100644 --- a/src/components/Feed/components/MainFeed.tsx +++ b/src/components/Feed/components/MainFeed.tsx @@ -60,16 +60,12 @@ export default function MainFeed(): React.JSX.Element { }, []); const onViewableItemsChanged = useCallback( - ({ viewableItems }: ViewableItemsChanged) => { + ({ viewableItems }: ViewableItemsChanged) => { const item = viewableItems?.[0]?.item; // If viewable items is null or empty, just return now if (item == null) return; - /* - This is a weird situation where we can't use the hook to get these setting values. FlashList does not support - updating the viewability config on the fly and as a result we have to resort to this. - */ const markReadOnFeedScroll = useSettingsStore.getState().readOptions.onFeedScroll; const markReadOnCommunityScroll = @@ -82,7 +78,7 @@ export default function MainFeed(): React.JSX.Element { ) { // Mark the first viewable post as read setPostRead({ - postId: item, + postId: item.postId, }); } },