diff --git a/src/components/views/Catalog.jsx b/src/components/views/Catalog.jsx
index eba19fc9..8a0c4f60 100644
--- a/src/components/views/Catalog.jsx
+++ b/src/components/views/Catalog.jsx
@@ -45,7 +45,9 @@ const Catalog = () => {
const { subplebbitAddress } = useParams();
const handleClickForm = useClickForm();
-
+ useEffect(() => {
+ console.log(feed);
+ }, [feed]);
useEffect(() => {
setSelectedAddress(subplebbitAddress);
@@ -330,66 +332,69 @@ const Catalog = () => {
- }
- >
- {feed.map(thread => {
- const commentMediaInfo = getCommentMediaInfo(thread);
- const fallbackImgUrl = "/assets/filedeleted-res.gif";
- return (
-
-
handleClickThread(thread.cid)}>
- {commentMediaInfo?.url ? (
-
- {commentMediaInfo?.type === "webpage" ? (
-
{
- e.target.src = fallbackImgUrl
- e.target.onerror = null;}} />
- ) : null}
- {commentMediaInfo?.type === "image" ? (
-
{
- e.target.src = fallbackImgUrl
- e.target.onerror = null;}} />
- ) : null}
- {commentMediaInfo?.type === "video" ? (
- {
- const img = document.querySelector(`img[key="img-${thread.cid}"]`);
- if (img) {
- img.src = thumbnail;
- }
- }}
- />
- ) : null}
- {commentMediaInfo?.type === "audio" ? (
-
{
- e.target.src = fallbackImgUrl
- e.target.onerror = null;}} />
- ) : null}
-
- ) : null}
-
- {/*
-
-
*/}
-
- R:
-
{thread.replyCount}
+ {feed.length < 1 ? (
+
+ ) : (
+
+ {feed.map(thread => {
+ const commentMediaInfo = getCommentMediaInfo(thread);
+ const fallbackImgUrl = "/assets/filedeleted-res.gif";
+ return (
+
+
handleClickThread(thread.cid)}>
+ {commentMediaInfo?.url ? (
+
+ {commentMediaInfo?.type === "webpage" ? (
+
{
+ e.target.src = fallbackImgUrl
+ e.target.onerror = null;}} />
+ ) : null}
+ {commentMediaInfo?.type === "image" ? (
+
{
+ e.target.src = fallbackImgUrl
+ e.target.onerror = null;}} />
+ ) : null}
+ {commentMediaInfo?.type === "video" ? (
+ {
+ const img = document.querySelector(`img[key="img-${thread.cid}"]`);
+ if (img) {
+ img.src = thumbnail;
+ }
+ }}
+ />
+ ) : null}
+ {commentMediaInfo?.type === "audio" ? (
+
{
+ e.target.src = fallbackImgUrl
+ e.target.onerror = null;}} />
+ ) : null}
+
+ ) : null}
+
+ {/*
+
+
*/}
+
+ R:
+ {thread.replyCount}
+
+
+ {thread.title ? `${thread.title}` : null}
+ {thread.content ? `: ${thread.content}` : null}
+
-
- {thread.title ? `${thread.title}` : null}
- {thread.content ? `: ${thread.content}` : null}
-
-
- )})}
-
+ )})}
+
+ )}
);