diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx
index 91935a0c..b41fdedc 100644
--- a/src/components/post-desktop/post-desktop.tsx
+++ b/src/components/post-desktop/post-desktop.tsx
@@ -498,8 +498,8 @@ const PostDesktop = ({ post, roles, showAllReplies, showReplies = true }: PostPr
)}
)}
- {/* Virtuoso infinite scroll for post page view with more than 25 replies */}
- {!isHidden && showAllReplies && !isInPendingPostView && showReplies && replyCount > 25 && (
+ {/* Virtuoso infinite scroll for post page view when there's more content to paginate */}
+ {!isHidden && showAllReplies && !isInPendingPostView && showReplies && hasMore && (
)}
- {/* Non-virtualized rendering for post page view with 25 or fewer replies */}
+ {/* Non-virtualized rendering for post page view when all replies fit on one page */}
{!isHidden &&
showAllReplies &&
!isInPendingPostView &&
showReplies &&
- replyCount <= 25 &&
+ !hasMore &&
filteredReplies.map((reply, index) => (
diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx
index def5d098..5e256d42 100644
--- a/src/components/post-mobile/post-mobile.tsx
+++ b/src/components/post-mobile/post-mobile.tsx
@@ -374,8 +374,8 @@ const PostMobile = ({ post, roles, showAllReplies, showReplies = true }: PostPro
)}
- {/* Virtuoso infinite scroll for post page view with more than 25 replies */}
- {!(pinned && !isInPostView) && showAllReplies && !isInPendingPostView && showReplies && replyCount > 25 && (
+ {/* Virtuoso infinite scroll for post page view when there's more content to paginate */}
+ {!(pinned && !isInPostView) && showAllReplies && !isInPendingPostView && showReplies && hasMore && (
)}
- {/* Non-virtualized rendering for post page view with 25 or fewer replies */}
+ {/* Non-virtualized rendering for post page view when all replies fit on one page */}
{!(pinned && !isInPostView) &&
showAllReplies &&
!isInPendingPostView &&
showReplies &&
- replyCount <= 25 &&
+ !hasMore &&
filteredReplies.map((reply, index) => (
diff --git a/src/views/board/board.tsx b/src/views/board/board.tsx
index 81e30577..2f0b1047 100644
--- a/src/views/board/board.tsx
+++ b/src/views/board/board.tsx
@@ -381,18 +381,28 @@ const Board = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp, t
)}
- }
- useWindowScroll={true}
- components={{ Footer }}
- endReached={loadMore}
- ref={virtuosoRef}
- restoreStateFrom={lastVirtuosoState}
- initialScrollTop={lastVirtuosoState?.scrollTop}
- />
+ {/* Use Virtuoso for infinite scroll only when there's more content to paginate */}
+ {hasMore ? (
+ }
+ useWindowScroll={true}
+ components={{ Footer }}
+ endReached={loadMore}
+ ref={virtuosoRef}
+ restoreStateFrom={lastVirtuosoState}
+ initialScrollTop={lastVirtuosoState?.scrollTop}
+ />
+ ) : (
+ <>
+ {combinedFeed.map((post, index) => (
+
+ ))}
+
+ >
+ )}
>
);
diff --git a/src/views/catalog/catalog.tsx b/src/views/catalog/catalog.tsx
index b4ba558b..8b823b45 100644
--- a/src/views/catalog/catalog.tsx
+++ b/src/views/catalog/catalog.tsx
@@ -540,18 +540,28 @@ const Catalog = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp,
{processedFeed?.length !== 0 ? (
<>
-
}
- useWindowScroll={true}
- components={{ Footer }}
- endReached={loadMore}
- ref={virtuosoRef}
- restoreStateFrom={lastVirtuosoState}
- initialScrollTop={lastVirtuosoState?.scrollTop}
- />
+ {/* Use Virtuoso for infinite scroll only when there's more content to paginate */}
+ {hasMore ? (
+ }
+ useWindowScroll={true}
+ components={{ Footer }}
+ endReached={loadMore}
+ ref={virtuosoRef}
+ restoreStateFrom={lastVirtuosoState}
+ initialScrollTop={lastVirtuosoState?.scrollTop}
+ />
+ ) : (
+ <>
+ {rows.map((row, index) => (
+
+ ))}
+
+ >
+ )}
>
) : (
diff --git a/src/views/mod-queue/mod-queue.tsx b/src/views/mod-queue/mod-queue.tsx
index 7e2307e9..bdee9f98 100644
--- a/src/views/mod-queue/mod-queue.tsx
+++ b/src/views/mod-queue/mod-queue.tsx
@@ -632,8 +632,8 @@ export const ModQueueView = ({ boardIdentifier: propBoardIdentifier }: ModQueueV
{t('actions')}
- {/* Use Virtuoso for infinite scroll only when feed is large enough to warrant it */}
- {feed.length > 25 ? (
+ {/* Use Virtuoso for infinite scroll only when there's more content to paginate */}
+ {hasMore ? (