From 9a101601fb937f551ff5bae12ad1c319d0ec9d21 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Fri, 2 Sep 2022 18:27:26 -0700 Subject: [PATCH] Also support lowest % first --- web/pages/contract-search-firestore.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/pages/contract-search-firestore.tsx b/web/pages/contract-search-firestore.tsx index 09c9a321..870fa99b 100644 --- a/web/pages/contract-search-firestore.tsx +++ b/web/pages/contract-search-firestore.tsx @@ -61,6 +61,10 @@ export default function ContractSearchFirestore(props: { matches = sortBy(matches, (c) => getProbability(c as BinaryContract | PseudoNumericContract) ).reverse() + } else if (sort === 'lowest-percent') { + matches = sortBy(matches, (c) => + getProbability(c as BinaryContract | PseudoNumericContract) + ) } if (additionalFilter) { @@ -109,12 +113,13 @@ export default function ContractSearchFirestore(props: { value={sort} onChange={(e) => setSort(e.target.value)} > - + +