From 41e3a34ab76ad0383ac91465b22913bd409a678b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 18 Dec 2023 01:47:38 -0500 Subject: [PATCH] fix: only check fetcher if we are greater than page 0 --- app/components/Feed.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/components/Feed.tsx b/app/components/Feed.tsx index 2ad80de..6093607 100644 --- a/app/components/Feed.tsx +++ b/app/components/Feed.tsx @@ -50,12 +50,14 @@ const Feed = ({ setCurrentPage((prevPage) => prevPage + 1); }; - if (fetcher.state === "loading") { - return
Loading...
; - } + if (currentPage) { + if (fetcher.state === "loading") { + return
Loading...
; + } - if (!fetcher.data) { - return
Failed to load
; + if (!fetcher.data) { + return
Failed to load
; + } } return (