diff --git a/client/src/containers/overview/filters/index.tsx b/client/src/containers/overview/filters/index.tsx index c191c298..a802a312 100644 --- a/client/src/containers/overview/filters/index.tsx +++ b/client/src/containers/overview/filters/index.tsx @@ -140,17 +140,6 @@ export default function ProjectsFilters() { 250, ); - useEffect(() => { - const resetCosts = async () => { - await setFilters((prev) => ({ - ...prev, - costRange: INITIAL_COST_RANGE[filters.costRangeSelector], - })); - }; - - resetCosts(); - }, [filters.costRangeSelector, setFilters]); - useEffect(() => { setCostValuesState([ filters.costRange[0] || INITIAL_COST_RANGE[filters.costRangeSelector][0], diff --git a/client/src/containers/overview/header/parameters/index.tsx b/client/src/containers/overview/header/parameters/index.tsx index 4a0049c2..e80a52e6 100644 --- a/client/src/containers/overview/header/parameters/index.tsx +++ b/client/src/containers/overview/header/parameters/index.tsx @@ -9,6 +9,8 @@ import { FILTER_KEYS } from "@/app/(overview)/constants"; import { useGlobalFilters } from "@/app/(overview)/url-store"; import { filtersSchema } from "@/app/(overview)/url-store"; +import { INITIAL_COST_RANGE } from "@/containers/overview/filters/constants"; + import { Label } from "@/components/ui/label"; import { Select, @@ -76,7 +78,13 @@ export default function ParametersProjects() { v: string, parameter: keyof Omit, "keyword">, ) => { - await setFilters((prev) => ({ ...prev, [parameter]: v })); + await setFilters((prev) => ({ + ...prev, + [parameter]: v, + ...(parameter === "costRangeSelector" && { + costRange: INITIAL_COST_RANGE[v as COST_TYPE_SELECTOR], + }), + })); }; return (