Check each word individually in markets search

This commit is contained in:
James Grugett 2022-02-28 17:52:41 -08:00
parent 71faee584c
commit 415bd4990a

View File

@ -205,9 +205,11 @@ export function SearchableGrid(props: {
}) {
const { contracts, query, setQuery, sort, setSort, byOneCreator } = props
const queryWords = query.toLowerCase().split(' ')
function check(corpus: String) {
return corpus.toLowerCase().includes(query.toLowerCase())
return queryWords.every((word) => corpus.toLowerCase().includes(word))
}
let matches = contracts.filter(
(c) =>
check(c.question) ||