From 9028dc1f9c436aa37ac95ada8432bcffff6bc482 Mon Sep 17 00:00:00 2001 From: "use-tusk[bot]" <144006087+use-tusk[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 05:14:39 +0000 Subject: [PATCH] fix: Tusk automated feedback for automated check failure --- web/components/templates/dashboard/dashboardPage.tsx | 3 +++ web/components/templates/requestsV2/requestsPageV2.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/web/components/templates/dashboard/dashboardPage.tsx b/web/components/templates/dashboard/dashboardPage.tsx index 7331384758..5fb7afe9cb 100644 --- a/web/components/templates/dashboard/dashboardPage.tsx +++ b/web/components/templates/dashboard/dashboardPage.tsx @@ -55,6 +55,7 @@ import StyledAreaChart from "./styledAreaChart"; import SuggestionModal from "./suggestionsModal"; import { useDashboardPage } from "./useDashboardPage"; import { IslandContainer } from "@/components/ui/islandContainer"; +import { DateRange } from "react-day-picker"; const ResponsiveGridLayout = WidthProvider(Responsive); @@ -170,6 +171,8 @@ const DashboardPage = (props: DashboardPageProps) => { const debouncedAdvancedFilter = useDebounce(advancedFilters, 500); + const debouncedRefetch = useDebounce(refetch, 500); + const timeIncrement = getTimeInterval(timeFilter); const { unauthorized, currentTier } = useGetUnauthorized(user.id); diff --git a/web/components/templates/requestsV2/requestsPageV2.tsx b/web/components/templates/requestsV2/requestsPageV2.tsx index 4103744997..e5d6828b8f 100644 --- a/web/components/templates/requestsV2/requestsPageV2.tsx +++ b/web/components/templates/requestsV2/requestsPageV2.tsx @@ -1,4 +1,5 @@ import { ArrowPathIcon, HomeIcon, PlusIcon } from "@heroicons/react/24/outline"; +import { DateRange } from "react-day-picker"; import Link from "next/link"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; @@ -257,6 +258,7 @@ const RequestsPageV2 = (props: RequestsPageV2Props) => { const [timeFilter, setTimeFilter] = useState(getTimeFilter()); const timeRange = useMemo(getTimeRange, []); + const debouncedRefetch = useDebounce(refetch, 500); const [advancedFilters, setAdvancedFilters] = useState( getRootFilterNode() @@ -873,6 +875,7 @@ const RequestsPageV2 = (props: RequestsPageV2Props) => { currentTimeFilter: timeRange, defaultValue: "1m", onTimeSelectHandler: onTimeSelectHandler, + onDateChange: onTimeSelectHandler, }} onRowSelect={(row, index) => { onRowSelectHandler(row, index);