Skip to content

Commit

Permalink
price filter issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
luisDev committed Apr 12, 2022
1 parent caa39cd commit 7334d4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/components/Map/Filter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export const MapFilter = () => {
const [ minPos, setMinPos ] = useState('') as any
const [ maxPos, setMaxPos ] = useState('') as any
const [ searchWallet, setSearchWallet ] = useState('') as any
const [ isFirst, setIsFirst ] = useState(true)

const dispatch = useDispatch<AppDispatch>()

Expand Down Expand Up @@ -260,6 +261,16 @@ export const MapFilter = () => {
}
}, [ searchOptions ])

useEffect(() => {
if( isFirst && searchOptions.maxPrice !== 1 ) {
setIsFirst(false)

let [ min, max ] = priceRangeValues
max = searchOptions.maxPrice
setPriceRangeValues([ min, max ])
}
}, [ searchOptions.maxPrice ])

useEffect(() => {
const [ min, max ] = priceRangeValues

Expand Down
2 changes: 1 addition & 1 deletion src/pages/Map/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Map extends Component<MapViewProps> {
componentDidMount() {
const mapData = this.props.landData

console.error(mapData)
// console.error(mapData)

const spritesArray: any[] = []
this.mapInfo = mapData
Expand Down

0 comments on commit 7334d4b

Please sign in to comment.