diff --git a/apps/dashboard/src/components/charts/chart-period.tsx b/apps/dashboard/src/components/charts/chart-period.tsx index e185c66f76..29f426ba84 100644 --- a/apps/dashboard/src/components/charts/chart-period.tsx +++ b/apps/dashboard/src/components/charts/chart-period.tsx @@ -9,15 +9,15 @@ import { format } from "date-fns"; import { useAction } from "next-safe-action/hook"; import { parseAsString, useQueryStates } from "next-usequerystate"; -export function ChartPeriod({ initialValue, defaultValue, disabled }) { +export function ChartPeriod({ defaultValue, value, disabled }) { let placeholder; const { execute } = useAction(changeChartPeriodAction); const [state, setState] = useQueryStates( { - from: parseAsString.withDefault(initialValue?.from ?? undefined), - to: parseAsString.withDefault(initialValue?.to ?? undefined), + from: parseAsString.withDefault(value?.from || defaultValue?.from), + to: parseAsString.withDefault(value?.to || defaultValue?.to), }, { shallow: false, diff --git a/apps/dashboard/src/components/charts/chart-selectors.tsx b/apps/dashboard/src/components/charts/chart-selectors.tsx index c35037f455..cbe5181f2e 100644 --- a/apps/dashboard/src/components/charts/chart-selectors.tsx +++ b/apps/dashboard/src/components/charts/chart-selectors.tsx @@ -9,7 +9,7 @@ export async function ChartSelectors({ value, defaultValue }) { return (