Skip to content

Commit

Permalink
pancakeswap#229: Fixed multisearch with platform filter
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRektora committed Oct 3, 2021
1 parent 66a09c4 commit ad2b04c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/views/Farms/Farms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const Farms: React.FC = () => {
)

const farmsList = useCallback(
(farmsToDisplay: Farm[], filterQuery?:boolean): FarmWithStakedValue[] => {
(farmsToDisplay: Farm[], filterQuery?: boolean): FarmWithStakedValue[] => {
let farmsToDisplayWithAPR: FarmWithStakedValue[] = farmsToDisplay.map((farm) => {
/* DZ Hack
if (!farm.lpTotalInQuoteToken || !prices) {
Expand Down Expand Up @@ -643,7 +643,12 @@ const Farms: React.FC = () => {


const handleItemClick = activeIndex => {
setMultiSearch(activeIndex)
const search = multiSearch
if (search.has('platform')) {
setMultiSearch(new Set<any>(activeIndex).add('platform'))
} else {
setMultiSearch(new Set(activeIndex))
}
setIsSearching(!isSearching)
setSortOption('multi')
}
Expand Down

0 comments on commit ad2b04c

Please sign in to comment.