From 2f4eb05233f8abff6f9b14bfa9beead00697a946 Mon Sep 17 00:00:00 2001 From: Timo Schneider Date: Wed, 19 Jun 2024 09:49:50 +0200 Subject: [PATCH] fixed post sorting for chrome and opera --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 5b49d6f..03bd1b7 100644 --- a/src/App.js +++ b/src/App.js @@ -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; }