From 47f95678bde8776f7a394a73a9a57d7fa16c9120 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sat, 19 Mar 2022 11:22:24 -0500 Subject: [PATCH] Fix closing soon sort --- web/components/contracts-list.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index c68e443c..0a294e54 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -241,7 +241,8 @@ export function SearchableGrid(props: { matches = _.sortBy(matches, ({ volume24Hours }) => -1 * volume24Hours) matches = _.sortBy( matches, - (contract) => -1 * (contract.closeTime ?? Infinity) + (contract) => + (sort === 'closed' ? -1 : 1) * (contract.closeTime ?? Infinity) ) const hideClosed = sort === 'closed' matches = matches.filter(