Add back ignore-filters-for behaviors (#2086)

zio/stable
Paul Frazee 2023-12-04 17:54:39 -08:00 committed by GitHub
parent d07ea64434
commit 74e0b73db5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -36,6 +36,7 @@ const LOAD_MORE_ERROR_ITEM = {_reactKey: '__load_more_error__'}
let Feed = ({ let Feed = ({
feed, feed,
feedParams, feedParams,
ignoreFilterFor,
style, style,
enabled, enabled,
pollInterval, pollInterval,
@ -53,6 +54,7 @@ let Feed = ({
}: { }: {
feed: FeedDescriptor feed: FeedDescriptor
feedParams?: FeedParams feedParams?: FeedParams
ignoreFilterFor?: string
style?: StyleProp<ViewStyle> style?: StyleProp<ViewStyle>
enabled?: boolean enabled?: boolean
pollInterval?: number pollInterval?: number
@ -202,6 +204,7 @@ let Feed = ({
slice={item} slice={item}
// we check for this before creating the feedItems array // we check for this before creating the feedItems array
moderationOpts={moderationOpts!} moderationOpts={moderationOpts!}
ignoreFilterFor={ignoreFilterFor}
/> />
) )
}, },
@ -212,6 +215,7 @@ let Feed = ({
onPressRetryLoadMore, onPressRetryLoadMore,
renderEmptyState, renderEmptyState,
moderationOpts, moderationOpts,
ignoreFilterFor,
], ],
) )

View File

@ -287,6 +287,7 @@ function ProfileScreenLoaded({
scrollElRef={ scrollElRef={
scrollElRef as React.MutableRefObject<FlatList<any> | null> scrollElRef as React.MutableRefObject<FlatList<any> | null>
} }
ignoreFilterFor={profile.did}
/> />
)} )}
{showRepliesTab {showRepliesTab
@ -307,6 +308,7 @@ function ProfileScreenLoaded({
scrollElRef={ scrollElRef={
scrollElRef as React.MutableRefObject<FlatList<any> | null> scrollElRef as React.MutableRefObject<FlatList<any> | null>
} }
ignoreFilterFor={profile.did}
/> />
) )
: null} : null}
@ -321,6 +323,7 @@ function ProfileScreenLoaded({
scrollElRef={ scrollElRef={
scrollElRef as React.MutableRefObject<FlatList<any> | null> scrollElRef as React.MutableRefObject<FlatList<any> | null>
} }
ignoreFilterFor={profile.did}
/> />
)} )}
{showLikesTab {showLikesTab
@ -341,6 +344,7 @@ function ProfileScreenLoaded({
scrollElRef={ scrollElRef={
scrollElRef as React.MutableRefObject<FlatList<any> | null> scrollElRef as React.MutableRefObject<FlatList<any> | null>
} }
ignoreFilterFor={profile.did}
/> />
) )
: null} : null}
@ -396,10 +400,19 @@ interface FeedSectionProps {
isFocused: boolean isFocused: boolean
isScrolledDown: boolean isScrolledDown: boolean
scrollElRef: React.MutableRefObject<FlatList<any> | null> scrollElRef: React.MutableRefObject<FlatList<any> | null>
ignoreFilterFor?: string
} }
const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
function FeedSectionImpl( function FeedSectionImpl(
{feed, onScroll, headerHeight, isFocused, isScrolledDown, scrollElRef}, {
feed,
onScroll,
headerHeight,
isFocused,
isScrolledDown,
scrollElRef,
ignoreFilterFor,
},
ref, ref,
) { ) {
const queryClient = useQueryClient() const queryClient = useQueryClient()
@ -432,6 +445,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>(
renderEmptyState={renderPostsEmpty} renderEmptyState={renderPostsEmpty}
headerOffset={headerHeight} headerOffset={headerHeight}
renderEndOfFeed={ProfileEndOfFeed} renderEndOfFeed={ProfileEndOfFeed}
ignoreFilterFor={ignoreFilterFor}
/> />
{(isScrolledDown || hasNew) && ( {(isScrolledDown || hasNew) && (
<LoadLatestBtn <LoadLatestBtn