Use client side contract search for emulator
This commit is contained in:
parent
d29115b05a
commit
cb68530e2a
|
@ -122,7 +122,7 @@ export function ContractSearch(props: {
|
|||
|
||||
const indexName = `${indexPrefix}contracts-${sort}`
|
||||
|
||||
if (IS_PRIVATE_MANIFOLD) {
|
||||
if (IS_PRIVATE_MANIFOLD || process.env.NEXT_PUBLIC_FIREBASE_EMULATE) {
|
||||
return (
|
||||
<ContractSearchFirestore
|
||||
querySortOptions={querySortOptions}
|
||||
|
|
|
@ -74,7 +74,7 @@ export function FreeResponseOutcomeLabel(props: {
|
|||
if (resolution === 'CANCEL') return <CancelLabel />
|
||||
if (resolution === 'MKT') return <MultiLabel />
|
||||
|
||||
const chosen = contract.answers.find((answer) => answer.id === resolution)
|
||||
const chosen = contract.answers?.find((answer) => answer.id === resolution)
|
||||
if (!chosen) return <AnswerNumberLabel number={resolution} />
|
||||
return (
|
||||
<FreeResponseAnswerToolTip text={chosen.text}>
|
||||
|
|
|
@ -9,6 +9,8 @@ import {
|
|||
useInitialQueryAndSort,
|
||||
} from 'web/hooks/use-sort-and-query-params'
|
||||
|
||||
const MAX_CONTRACTS_RENDERED = 100
|
||||
|
||||
export default function ContractSearchFirestore(props: {
|
||||
querySortOptions?: {
|
||||
defaultSort: Sort
|
||||
|
@ -80,6 +82,8 @@ export default function ContractSearchFirestore(props: {
|
|||
}
|
||||
}
|
||||
|
||||
matches = matches.slice(0, MAX_CONTRACTS_RENDERED)
|
||||
|
||||
const showTime = ['close-date', 'closed'].includes(sort)
|
||||
? 'close-date'
|
||||
: sort === 'resolve-date'
|
||||
|
|
Loading…
Reference in New Issue
Block a user