Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Feed fixes: repeat posts & nonreplies showing up in the wrong place (#516)

* Fix the repeat posts issue on the home feed

* Fix: replies no longer show up in the no-replies feed

authored by

Paul Frazee and committed by
GitHub
5085861b d35f7c1f

+31 -7
+4 -6
src/state/models/feeds/posts.ts
··· 294 294 const isRepost = 295 295 item?.reasonRepost?.by?.handle === params.actor || 296 296 item?.reasonRepost?.by?.did === params.actor 297 - return ( 298 - !item.reply || // not a reply 299 - isRepost || // but allow if it's a repost 300 - (slice.isThread && // or a thread by the user 301 - item.reply?.root.author.did === item.post.author.did) 302 - ) 297 + const allow = 298 + !item.postRecord?.reply || // not a reply 299 + isRepost // but allow if it's a repost 300 + return allow 303 301 }) 304 302 } else { 305 303 return this.slices
+27 -1
src/view/screens/Home.tsx
··· 6 6 import {NativeStackScreenProps, HomeTabNavigatorParams} from 'lib/routes/types' 7 7 import {PostsFeedModel} from 'state/models/feeds/posts' 8 8 import {withAuthRequired} from 'view/com/auth/withAuthRequired' 9 + import {useTabFocusEffect} from 'lib/hooks/useTabFocusEffect' 9 10 import {Feed} from '../com/posts/Feed' 10 11 import {FollowingEmptyState} from 'view/com/posts/FollowingEmptyState' 11 12 import {LoadLatestBtn} from '../com/util/load-latest/LoadLatestBtn' ··· 143 144 144 145 const onSoftReset = React.useCallback(() => { 145 146 if (isPageFocused) { 147 + feed.refresh() 146 148 scrollToTop() 147 149 } 148 - }, [isPageFocused, scrollToTop]) 150 + }, [isPageFocused, scrollToTop, feed]) 149 151 150 152 useFocusEffect( 151 153 React.useCallback(() => { ··· 165 167 feedCleanup() 166 168 } 167 169 }, [store, doPoll, onSoftReset, screen, feed]), 170 + ) 171 + useTabFocusEffect( 172 + 'Home', 173 + React.useCallback( 174 + isInside => { 175 + if (!isPageFocused) { 176 + return 177 + } 178 + // on mobile: 179 + // fires with `isInside=true` when the user navigates to the root tab 180 + // but not when the user goes back to the screen by pressing back 181 + // on web: 182 + // essentially equivalent to useFocusEffect because we dont used tabbed 183 + // navigation 184 + if (isInside) { 185 + if (feed.hasNewLatest) { 186 + feed.refresh() 187 + } else { 188 + feed.checkForLatest() 189 + } 190 + } 191 + }, 192 + [isPageFocused, feed], 193 + ), 168 194 ) 169 195 170 196 const onPressCompose = React.useCallback(() => {