mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
only show account comment in feed if state is 'succeeded'
This commit is contained in:
@@ -33,13 +33,14 @@ const useCatalogFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolea
|
|||||||
|
|
||||||
// show account comments instantly in the feed instead of waiting for the next feed update, then hide them when they are in the feed
|
// show account comments instantly in the feed instead of waiting for the next feed update, then hide them when they are in the feed
|
||||||
accountComments.forEach((comment) => {
|
accountComments.forEach((comment) => {
|
||||||
const { cid, deleted, link, postCid, removed, subplebbitAddress } = comment || {};
|
const { cid, deleted, link, postCid, removed, state, subplebbitAddress } = comment || {};
|
||||||
const commentMediaInfo = getCommentMediaInfo(comment);
|
const commentMediaInfo = getCommentMediaInfo(comment);
|
||||||
const isMediaShowed = getHasThumbnail(commentMediaInfo, link);
|
const isMediaShowed = getHasThumbnail(commentMediaInfo, link);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!deleted &&
|
!deleted &&
|
||||||
!removed &&
|
!removed &&
|
||||||
|
state === 'succeeded' &&
|
||||||
(!showTextOnlyThreads || (showTextOnlyThreads && !isMediaShowed)) &&
|
(!showTextOnlyThreads || (showTextOnlyThreads && !isMediaShowed)) &&
|
||||||
cid &&
|
cid &&
|
||||||
cid === postCid &&
|
cid === postCid &&
|
||||||
|
|||||||
@@ -27,8 +27,16 @@ const AccountCommentsNotYetInFeed = ({ subplebbitAddress, feed }: { subplebbitAd
|
|||||||
const _feed = [...feed];
|
const _feed = [...feed];
|
||||||
|
|
||||||
const filteredComments = accountComments.filter((comment) => {
|
const filteredComments = accountComments.filter((comment) => {
|
||||||
const { cid, deleted, postCid, removed } = comment || {};
|
const { cid, deleted, postCid, removed, state } = comment || {};
|
||||||
return !deleted && !removed && cid && cid === postCid && comment?.subplebbitAddress === subplebbitAddress && !_feed.some((post) => post.cid === cid);
|
return (
|
||||||
|
!deleted &&
|
||||||
|
!removed &&
|
||||||
|
state === 'succeeded' &&
|
||||||
|
cid &&
|
||||||
|
cid === postCid &&
|
||||||
|
comment?.subplebbitAddress === subplebbitAddress &&
|
||||||
|
!_feed.some((post) => post.cid === cid)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return filteredComments.map((comment) => <Post key={comment.cid} post={comment} />);
|
return filteredComments.map((comment) => <Post key={comment.cid} post={comment} />);
|
||||||
|
|||||||
Reference in New Issue
Block a user