From f4e57a2831fade57d5e7b0bb25fbfd604f8fbcf0 Mon Sep 17 00:00:00 2001 From: wonfen Date: Fri, 16 May 2025 18:03:02 +0800 Subject: [PATCH] fix: retain traffic data when switching chart time range --- src/components/home/enhanced-traffic-graph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/home/enhanced-traffic-graph.tsx b/src/components/home/enhanced-traffic-graph.tsx index f0cfbe8a..2f93a6ee 100644 --- a/src/components/home/enhanced-traffic-graph.tsx +++ b/src/components/home/enhanced-traffic-graph.tsx @@ -150,7 +150,7 @@ export const EnhancedTrafficGraph = memo(forwardRef( // 更新显示数据 const pointsToShow = getMaxPointsByTimeRange(timeRange); setDisplayData(initialBuffer.slice(-pointsToShow)); - }, [MAX_BUFFER_SIZE, getMaxPointsByTimeRange, timeRange]); + }, [MAX_BUFFER_SIZE, getMaxPointsByTimeRange]); // 添加数据点方法 const appendData = useCallback((data: ITrafficItem) => { const safeData = {