Skip to content

Commit

Permalink
make empty feed required (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansh authored Oct 10, 2023
1 parent 4d450da commit aa085b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/view/com/posts/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Feed = observer(function Feed({
onPressTryAgain?: () => void
onScroll?: OnScrollCb
scrollEventThrottle?: number
renderEmptyState?: () => JSX.Element
renderEmptyState: () => JSX.Element
renderEndOfFeed?: () => JSX.Element
testID?: string
headerOffset?: number
Expand Down Expand Up @@ -116,10 +116,7 @@ export const Feed = observer(function Feed({
const renderItem = React.useCallback(
({item}: {item: any}) => {
if (item === EMPTY_FEED_ITEM) {
if (renderEmptyState) {
return renderEmptyState()
}
return <View />
return renderEmptyState()
} else if (item === ERROR_ITEM) {
return (
<ErrorMessage
Expand Down
2 changes: 1 addition & 1 deletion src/view/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const FeedPage = observer(function FeedPageImpl({
testID?: string
feed: PostsFeedModel
isPageFocused: boolean
renderEmptyState?: () => JSX.Element
renderEmptyState: () => JSX.Element
renderEndOfFeed?: () => JSX.Element
}) {
const store = useStores()
Expand Down

0 comments on commit aa085b0

Please sign in to comment.