From 5f4908b072039f2d78199af8463c8f38a19b2631 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 18 Mar 2022 21:15:27 -0500 Subject: [PATCH] Invert closed markets sort --- web/components/contracts-list.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index cb003d80..cf5364fd 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -236,7 +236,10 @@ export function SearchableGrid(props: { matches.sort((a, b) => a.createdTime - b.createdTime) } else if (sort === 'close-date' || sort === 'closed') { matches = _.sortBy(matches, ({ volume24Hours }) => -1 * volume24Hours) - matches = _.sortBy(matches, (contract) => contract.closeTime) + matches = _.sortBy( + matches, + (contract) => -1 * (contract.closeTime ?? Infinity) + ) const hideClosed = sort === 'closed' matches = matches.filter( ({ closeTime }) => closeTime && closeTime > Date.now() !== hideClosed