diff --git a/apps/mobile/src/modules/entry-list/EntryListContentArticle.tsx b/apps/mobile/src/modules/entry-list/EntryListContentArticle.tsx index 5fcc257b1..e85c46cf9 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, isLoading } = useFetchEntriesControls() + const { fetchNextPage, isFetching, refetch, isRefetching } = useFetchEntriesControls() const renderItem = useCallback( ({ item: id, extraData }: ListRenderItemInfo) => ( @@ -32,7 +32,7 @@ export const EntryListContentArticle = forwardRef< ) const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isLoading, + disabled: active === false || isFetching, }) return ( diff --git a/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx b/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx index 38e021036..659adbe90 100644 --- a/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx +++ b/apps/mobile/src/modules/entry-list/EntryListContentPicture.tsx @@ -18,9 +18,10 @@ export const EntryListContentPicture = forwardRef< "data" | "renderItem" > >(({ entryIds, active, ...rest }, ref) => { - const { fetchNextPage, refetch, isRefetching, hasNextPage, isLoading } = useFetchEntriesControls() + const { fetchNextPage, refetch, isRefetching, hasNextPage, isFetching } = + useFetchEntriesControls() const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isLoading, + disabled: active === false || isFetching, }) return ( diff --git a/apps/mobile/src/modules/entry-list/EntryListContentSocial.tsx b/apps/mobile/src/modules/entry-list/EntryListContentSocial.tsx index bb010bf74..852d9300f 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, isLoading } = useFetchEntriesControls() + const { fetchNextPage, isFetching, refetch, isRefetching } = useFetchEntriesControls() const renderItem = useCallback( ({ item: id }: ListRenderItemInfo) => , @@ -26,7 +26,7 @@ export const EntryListContentSocial = forwardRef< ) const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isLoading, + disabled: active === false || isFetching, }) return ( diff --git a/apps/mobile/src/modules/entry-list/EntryListContentVideo.tsx b/apps/mobile/src/modules/entry-list/EntryListContentVideo.tsx index 227f372d7..c597aec75 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, isLoading } = useFetchEntriesControls() + const { fetchNextPage, refetch, isRefetching, isFetching } = useFetchEntriesControls() const { onViewableItemsChanged, onScroll } = useOnViewableItemsChanged({ - disabled: active === false || isLoading, + disabled: active === false || isFetching, }) const ListFooterComponent = useMemo( diff --git a/apps/mobile/src/modules/entry-list/index.tsx b/apps/mobile/src/modules/entry-list/index.tsx index f556312ef..b140dcf97 100644 --- a/apps/mobile/src/modules/entry-list/index.tsx +++ b/apps/mobile/src/modules/entry-list/index.tsx @@ -49,17 +49,18 @@ const AnimatedPagerView = Animated.createAnimatedComponent(Pag function ViewPagerList({ viewId }: { viewId: FeedViewType }) { const activeViews = useViewWithSubscription() + const viewIdIndex = activeViews.findIndex((view) => view.view === viewId) const { page, pagerRef, ...rest } = usePagerView({ - initialPage: viewId, + initialPage: viewIdIndex, onIndexChange: (index) => { - selectTimeline({ type: "view", viewId: index }) + selectTimeline({ type: "view", viewId: activeViews[index]!.view }) }, }) useEffect(() => { - if (page === viewId) return - pagerRef.current?.setPage(viewId) - }, [page, pagerRef, viewId]) + if (page === viewIdIndex) return + pagerRef.current?.setPage(viewIdIndex) + }, [page, pagerRef, viewIdIndex]) return ( {useMemo( () => - activeViews.map((view) => ( - + activeViews.map((view, index) => ( + )), [activeViews, page], )}