mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(feed): old account comments could appear at the top of the feed
This commit is contained in:
@@ -33,13 +33,14 @@ const useCatalogFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolea
|
|||||||
|
|
||||||
// show account comments instantly in the feed once published (cid defined), instead of waiting for the feed to update
|
// show account comments instantly in the feed once published (cid defined), instead of waiting for the feed to update
|
||||||
const filteredComments = accountComments.filter((comment) => {
|
const filteredComments = accountComments.filter((comment) => {
|
||||||
const { cid, deleted, link, postCid, removed, state, subplebbitAddress } = comment || {};
|
const { cid, deleted, link, postCid, removed, state, subplebbitAddress, timestamp } = comment || {};
|
||||||
const commentMediaInfo = getCommentMediaInfo(comment);
|
const commentMediaInfo = getCommentMediaInfo(comment);
|
||||||
const isMediaShowed = getHasThumbnail(commentMediaInfo, link);
|
const isMediaShowed = getHasThumbnail(commentMediaInfo, link);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
!deleted &&
|
!deleted &&
|
||||||
!removed &&
|
!removed &&
|
||||||
|
timestamp > Date.now() - 60 * 60 * 1000 &&
|
||||||
state === 'succeeded' &&
|
state === 'succeeded' &&
|
||||||
(!hideThreadsWithoutImages || (hideThreadsWithoutImages && isMediaShowed)) &&
|
(!hideThreadsWithoutImages || (hideThreadsWithoutImages && isMediaShowed)) &&
|
||||||
cid &&
|
cid &&
|
||||||
|
|||||||
@@ -80,10 +80,11 @@ const Board = () => {
|
|||||||
const filteredComments = useMemo(
|
const filteredComments = useMemo(
|
||||||
() =>
|
() =>
|
||||||
accountComments.filter((comment) => {
|
accountComments.filter((comment) => {
|
||||||
const { cid, deleted, postCid, removed, state } = comment || {};
|
const { cid, deleted, postCid, removed, state, timestamp } = comment || {};
|
||||||
return (
|
return (
|
||||||
!deleted &&
|
!deleted &&
|
||||||
!removed &&
|
!removed &&
|
||||||
|
timestamp > Date.now() - 60 * 60 * 1000 &&
|
||||||
state === 'succeeded' &&
|
state === 'succeeded' &&
|
||||||
cid &&
|
cid &&
|
||||||
(hideThreadsWithoutImages ? getHasThumbnail(getCommentMediaInfo(comment), comment?.link) : true) &&
|
(hideThreadsWithoutImages ? getHasThumbnail(getCommentMediaInfo(comment), comment?.link) : true) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user