fixed post sorting for chrome and opera

This commit is contained in:
2024-06-19 09:49:50 +02:00
parent 34e44d2310
commit 2f4eb05233

View File

@@ -35,7 +35,7 @@ const App = () => {
const recursiveSort = (posts) => {
posts.forEach((post, index) => {posts[index].comments = recursiveSort(post.comments)});
posts.sort((a, b) => a.date < b.date);
posts.sort((a, b) => a.date < b.date ? 1 : -1);
return posts;
}