fixed post sorting for chrome and opera
This commit is contained in:
@@ -35,7 +35,7 @@ const App = () => {
|
|||||||
|
|
||||||
const recursiveSort = (posts) => {
|
const recursiveSort = (posts) => {
|
||||||
posts.forEach((post, index) => {posts[index].comments = recursiveSort(post.comments)});
|
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;
|
return posts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user