Ignore filter on contract status when searching

This commit is contained in:
James Grugett 2022-07-29 17:37:53 -07:00
parent d6cf4332da
commit 003301762c

View File

@ -116,7 +116,9 @@ export function ContractSearch(props: {
track('select search category', { category: pill ?? 'all' }) track('select search category', { category: pill ?? 'all' })
} }
let facetFilters = [ let facetFilters = query
? []
: [
filter === 'open' ? 'isResolved:false' : '', filter === 'open' ? 'isResolved:false' : '',
filter === 'closed' ? 'isResolved:false' : '', filter === 'closed' ? 'isResolved:false' : '',
filter === 'resolved' ? 'isResolved:true' : '', filter === 'resolved' ? 'isResolved:true' : '',
@ -151,7 +153,9 @@ export function ContractSearch(props: {
// Hack to make Algolia work. // Hack to make Algolia work.
facetFilters = ['', ...facetFilters] facetFilters = ['', ...facetFilters]
const numericFilters = [ const numericFilters = query
? []
: [
filter === 'open' ? `closeTime > ${Date.now()}` : '', filter === 'open' ? `closeTime > ${Date.now()}` : '',
filter === 'closed' ? `closeTime <= ${Date.now()}` : '', filter === 'closed' ? `closeTime <= ${Date.now()}` : '',
].filter((f) => f) ].filter((f) => f)
@ -253,6 +257,7 @@ export function ContractSearch(props: {
placeholder={showPlaceHolder ? `Search ${filter} markets` : ''} placeholder={showPlaceHolder ? `Search ${filter} markets` : ''}
className="input input-bordered w-full" className="input input-bordered w-full"
/> />
{!query && (
<select <select
className="select select-bordered" className="select select-bordered"
value={filter} value={filter}
@ -263,6 +268,7 @@ export function ContractSearch(props: {
<option value="resolved">Resolved</option> <option value="resolved">Resolved</option>
<option value="all">All</option> <option value="all">All</option>
</select> </select>
)}
{!hideOrderSelector && ( {!hideOrderSelector && (
<select <select
className="select select-bordered" className="select select-bordered"