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];
|
||||
}).flat();
|
||||
return renderedComments;
|
||||
|
||||
const sortedComments = renderedComments.sort((a, b) => a.timestamp - b.timestamp);
|
||||
return sortedComments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<Container>
|
||||
|
||||
@@ -22,6 +22,7 @@ function renderComments(comments) {
|
||||
};
|
||||
|
||||
const renderedComments = comments.flatMap(renderComment);
|
||||
renderedComments.sort((a, b) => a.timestamp - b.timestamp);
|
||||
|
||||
return { renderedComments, omittedCount };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user