Skip to content

Commit

Permalink
fix: update all parcels on year change
Browse files Browse the repository at this point in the history
  • Loading branch information
pjsier committed Nov 8, 2024
1 parent ddceec1 commit 5537d3d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/src/components/Search/AllParcels.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import React, { useEffect } from "react"
import { useSelector } from "react-redux"
import { Link } from "react-router-dom"
import {
Expand All @@ -17,9 +17,19 @@ import { DEFAULT_YEAR, MINIMUM_YEAR } from "../../utils/constants"
import questionMarkRose from "../../assets/img/question_mark_rose.svg"
import mapMarkerRose from "../../assets/img/map_marker_rose.svg"
import infoIcon from "../../assets/img/info-icon.png"
import { useDispatch } from "react-redux"
import { handleAllTotalsQuery } from "../../actions/search"

function AllParcels(props) {
const year = props.queryParams?.year || DEFAULT_YEAR

const dispatch = useDispatch()
useEffect(() => {
if (props.queryParams?.year) {
dispatch(handleAllTotalsQuery(props.queryParams.year))
}
}, [props.queryParams?.year])

const { timelineData, topSpeculators } = useSelector(
(state) => state.searchState.allTotals
)
Expand Down

0 comments on commit 5537d3d

Please sign in to comment.