fix: only check fetcher if we are greater than page 0
This commit is contained in:
parent
b88c14407f
commit
41e3a34ab7
|
@ -50,6 +50,7 @@ const Feed = ({
|
||||||
setCurrentPage((prevPage) => prevPage + 1);
|
setCurrentPage((prevPage) => prevPage + 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (currentPage) {
|
||||||
if (fetcher.state === "loading") {
|
if (fetcher.state === "loading") {
|
||||||
return <div>Loading...</div>;
|
return <div>Loading...</div>;
|
||||||
}
|
}
|
||||||
|
@ -57,6 +58,7 @@ const Feed = ({
|
||||||
if (!fetcher.data) {
|
if (!fetcher.data) {
|
||||||
return <div>Failed to load</div>;
|
return <div>Failed to load</div>;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={`w-full h-full space-y-6 ${className}`}>
|
<section className={`w-full h-full space-y-6 ${className}`}>
|
||||||
|
|
Loading…
Reference in New Issue