diff --git a/apps/mobile/src/modules/entry-list/EntryListContentArticle.tsx b/apps/mobile/src/modules/entry-list/EntryListContentArticle.tsx index e85c46cf9..5fcc257b1 100644 --- a/apps/mobile/src/modules/entry-list/EntryListContentArticle.tsx +++ b/apps/mobile/src/modules/entry-list/EntryListContentArticle.tsx @@ -17,7 +17,7 @@ export const EntryListContentArticle = forwardRef< >(({ entryIds, active }, ref) => { const playingAudioUrl = usePlayingUrl() - const { fetchNextPage, isFetching, refetch, isRefetching } = useFetchEntriesControls() + const { fetchNextPage, isFetching, refetch, isRefetching, isLoading } = useFetchEntriesControls() const renderItem = useCallback( ({ item: id, extraData }: ListRenderItemInfo) => ( @@ -32,7 +32,7 @@ export const EntryListContentArticle = forwardRef< ) const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isFetching, + disabled: active === false || isLoading, }) return ( diff --git a/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx b/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx index 659adbe90..38e021036 100644 --- a/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx +++ b/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx @@ -18,10 +18,9 @@ export const EntryListContentPicture = forwardRef< "data" | "renderItem" > >(({ entryIds, active, ...rest }, ref) => { - const { fetchNextPage, refetch, isRefetching, hasNextPage, isFetching } = - useFetchEntriesControls() + const { fetchNextPage, refetch, isRefetching, hasNextPage, isLoading } = useFetchEntriesControls() const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isFetching, + disabled: active === false || isLoading, }) return ( diff --git a/apps/mobile/src/modules/entry-list/EntryListContentSocial.tsx b/apps/mobile/src/modules/entry-list/EntryListContentSocial.tsx index 852d9300f..bb010bf74 100644 --- a/apps/mobile/src/modules/entry-list/EntryListContentSocial.tsx +++ b/apps/mobile/src/modules/entry-list/EntryListContentSocial.tsx @@ -13,7 +13,7 @@ export const EntryListContentSocial = forwardRef< ElementRef, { entryIds: string[]; active?: boolean } >(({ entryIds, active }, ref) => { - const { fetchNextPage, isFetching, refetch, isRefetching } = useFetchEntriesControls() + const { fetchNextPage, isFetching, refetch, isRefetching, isLoading } = useFetchEntriesControls() const renderItem = useCallback( ({ item: id }: ListRenderItemInfo) => , @@ -26,7 +26,7 @@ export const EntryListContentSocial = forwardRef< ) const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isFetching, + disabled: active === false || isLoading, }) return ( diff --git a/apps/mobile/src/modules/entry-list/EntryListContentVideo.tsx b/apps/mobile/src/modules/entry-list/EntryListContentVideo.tsx index c597aec75..227f372d7 100644 --- a/apps/mobile/src/modules/entry-list/EntryListContentVideo.tsx +++ b/apps/mobile/src/modules/entry-list/EntryListContentVideo.tsx @@ -17,9 +17,9 @@ export const EntryListContentVideo = forwardRef< "data" | "renderItem" > >(({ entryIds, active, ...rest }, ref) => { - const { fetchNextPage, refetch, isRefetching, isFetching } = useFetchEntriesControls() + const { fetchNextPage, refetch, isRefetching, isFetching, isLoading } = useFetchEntriesControls() const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isFetching, + disabled: active === false || isLoading, }) const ListFooterComponent = useMemo( diff --git a/apps/mobile/src/modules/entry-list/index.tsx b/apps/mobile/src/modules/entry-list/index.tsx index b61ba3b63..f556312ef 100644 --- a/apps/mobile/src/modules/entry-list/index.tsx +++ b/apps/mobile/src/modules/entry-list/index.tsx @@ -3,7 +3,6 @@ import { useEffect, useMemo } from "react" import { Animated, StyleSheet } from "react-native" import PagerView from "react-native-pager-view" -import { views } from "@/src/constants/views" import { selectTimeline, useSelectedFeed, useSelectedView } from "@/src/modules/screen/atoms" import { useEntryIdsByCategory, @@ -12,6 +11,7 @@ import { useEntryIdsByView, } from "@/src/store/entry/hooks" import { useListEntryIds } from "@/src/store/list/hooks" +import { useViewWithSubscription } from "@/src/store/subscription/hooks" import { TimelineSelectorProvider } from "../screen/TimelineSelectorProvider" import { EntryListSelector } from "./EntryListSelector" @@ -48,6 +48,7 @@ export function EntryList() { const AnimatedPagerView = Animated.createAnimatedComponent(PagerView) function ViewPagerList({ viewId }: { viewId: FeedViewType }) { + const activeViews = useViewWithSubscription() const { page, pagerRef, ...rest } = usePagerView({ initialPage: viewId, onIndexChange: (index) => { @@ -76,10 +77,10 @@ function ViewPagerList({ viewId }: { viewId: FeedViewType }) { > {useMemo( () => - views.map((view) => ( + activeViews.map((view) => ( )), - [page], + [activeViews, page], )} )