From bf0bfc693e9c88d1efba5e85d3dc4fc591e9a5c4 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 11 Jun 2024 22:19:37 +0200 Subject: [PATCH] removed sort function which is now done by backend --- src/App.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index d97e40b..a888380 100644 --- a/src/App.js +++ b/src/App.js @@ -126,6 +126,7 @@ function VoteRequest(id, up) { } // Create a function to compare date values +/* function comparePublishedAt(a, b) { // Check if PublishedAt for both a and b is empty if (!a.PublishedAt && !b.PublishedAt) { @@ -150,7 +151,7 @@ function comparePublishedAt(a, b) { return 1; } return 0; -} +} */ function dateDiffInDays(a, b) { const diffInMs = Math.abs(b - a); @@ -228,7 +229,7 @@ function App() { ) : products.NewProducts.length > 0 ? ( <> - {products.NewProducts.sort(comparePublishedAt).map( + {products.NewProducts /*.sort(comparePublishedAt) */.map( (product, index) => (showMore.newProducts || index < 5) && (