mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
sorted comments by timestamp
This commit is contained in:
@@ -184,10 +184,12 @@ const Thread = ({ setBodyStyle }) => {
|
|||||||
}
|
}
|
||||||
return [comment];
|
return [comment];
|
||||||
}).flat();
|
}).flat();
|
||||||
return renderedComments;
|
|
||||||
|
const sortedComments = renderedComments.sort((a, b) => a.timestamp - b.timestamp);
|
||||||
|
return sortedComments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ function renderComments(comments) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderedComments = comments.flatMap(renderComment);
|
const renderedComments = comments.flatMap(renderComment);
|
||||||
|
renderedComments.sort((a, b) => a.timestamp - b.timestamp);
|
||||||
|
|
||||||
return { renderedComments, omittedCount };
|
return { renderedComments, omittedCount };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user