From 87fcc80898916a8de1e34cd1c3ece1b75cc4cb83 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 6 Jul 2023 13:14:20 +0200 Subject: [PATCH] fix loading state of empty feed --- src/components/views/All.jsx | 6 +++--- src/components/views/AllCatalog.jsx | 4 ++-- src/components/views/Board.jsx | 6 +++--- src/components/views/Catalog.jsx | 4 ++-- src/components/views/Subscriptions.jsx | 14 +++++++------- src/components/views/SubscriptionsCatalog.jsx | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/components/views/All.jsx b/src/components/views/All.jsx index e4ff28d1..a4a4a254 100755 --- a/src/components/views/All.jsx +++ b/src/components/views/All.jsx @@ -585,7 +585,7 @@ const All = () => { Catalog ] - {feed.length > 0 ? ( + {feed ? ( null ) : (
@@ -601,7 +601,7 @@ const All = () => {
- {feed.length > 0 ? ( + {feed ? ( { }} endReached={tryLoadMore} useWindowScroll={true} - components={{ Footer: hasMore ? () => : null }} + components={{ Footer: hasMore && feed ? () => : null }} /> ) : ( diff --git a/src/components/views/AllCatalog.jsx b/src/components/views/AllCatalog.jsx index 028000d9..cf9b5a63 100755 --- a/src/components/views/AllCatalog.jsx +++ b/src/components/views/AllCatalog.jsx @@ -442,7 +442,7 @@ const AllCatalog = () => { Return
- {feed.length > 0 ? ( + {feed ? ( null ) : (
@@ -453,7 +453,7 @@ const AllCatalog = () => { - {feed.length > 0 ? ( + {feed ? ( { {window.scrollTo(0, 0)}}>Catalog ]
- {feed.length > 0 ? ( + {subplebbit?.state === "succeeded" ? ( <> [ @@ -840,7 +840,7 @@ const Board = () => { {subplebbit?.state === "failed" ? ( null ) : ( - feed.length > 0 ? ( + feed ? ( <> {subplebbit.rules ? <> @@ -2685,7 +2685,7 @@ const Board = () => { }} endReached={tryLoadMore} useWindowScroll={true} - components={{ Footer: hasMore && feed.length > 0 ? () => : null }} + components={{ Footer: hasMore && feed ? () => : null }} /> ) : () diff --git a/src/components/views/Catalog.jsx b/src/components/views/Catalog.jsx index 633b6427..8702120b 100755 --- a/src/components/views/Catalog.jsx +++ b/src/components/views/Catalog.jsx @@ -665,7 +665,7 @@ const Catalog = () => { {window.scrollTo(0, 0)}}>Return ]
- {feed.length > 0 ? ( + {feed ? ( <> [ @@ -699,7 +699,7 @@ const Catalog = () => { {subplebbit?.state === "failed" ? ( null ) : ( - feed.length > 0 ? ( + feed ? ( { setCommentCid(comment.cid); setOriginalCommentContent(comment.content); setIsEditModalOpen(true); - } - - + }; + + useEffect(() => { setPublishCommentEditOptions((prevOptions) => ({ ...prevOptions, @@ -563,7 +563,7 @@ const Subscriptions = () => { <>
Subscriptions
- {feed.length < 1 ? ( + {account.subscriptions.length < 1 ? (
You haven't subscribed to any board yet.
) : (
@@ -593,7 +593,7 @@ const Subscriptions = () => { Catalog ]
- {feed.length > 0 ? ( + {feed ? ( null ) : (
@@ -609,7 +609,7 @@ const Subscriptions = () => {
- { feed.length < 1 ? ( + { feed ? ( null ) : ( { }} endReached={tryLoadMore} useWindowScroll={true} - components={{ Footer: hasMore ? () => : null }} + components={{ Footer: hasMore && feed ? () => : null }} /> )}
diff --git a/src/components/views/SubscriptionsCatalog.jsx b/src/components/views/SubscriptionsCatalog.jsx index 037debc3..539f45e0 100755 --- a/src/components/views/SubscriptionsCatalog.jsx +++ b/src/components/views/SubscriptionsCatalog.jsx @@ -411,7 +411,7 @@ const SubscriptionsCatalog = () => {
<>
Subscriptions
- {feed.length < 1 ? ( + {account.subscriptions.length < 1 ? (
You haven't subscribed to any board yet.
) : (
@@ -446,7 +446,7 @@ const SubscriptionsCatalog = () => { Return
- {feed.length > 0 ? ( + {feed ? ( null ) : (
@@ -457,7 +457,7 @@ const SubscriptionsCatalog = () => { - {feed.length > 0 ? ( + {feed ? (