From 14252915ab931e85cdee67f49e13a5273ab60cc2 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 26 May 2026 09:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=9B=BE=E8=A1=A8=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=97=B6=E7=9A=84=E6=AF=9B=E7=8E=BB=E7=92=83=20loadin?= =?UTF-8?q?g=20=E8=92=99=E5=B1=82=EF=BC=8C=E6=94=B9=E4=B8=BA=E9=9D=99?= =?UTF-8?q?=E9=BB=98=E5=90=8E=E5=8F=B0=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LiveTemperatureThresholdChart.tsx | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx b/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx index 030e7bca..b78d8501 100644 --- a/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx +++ b/frontend/components/dashboard/scan-terminal/LiveTemperatureThresholdChart.tsx @@ -2,7 +2,6 @@ import clsx from "clsx"; import { useEffect, useMemo, useState } from "react"; -import { LoadingSignal } from "@/components/dashboard/scan-terminal/LoadingSignal"; import { CartesianGrid, Line, @@ -1155,7 +1154,6 @@ export function LiveTemperatureThresholdChart({ slotIndex?: number; }) { const [hourly, setHourly] = useState(null); - const [isFetching, setIsFetching] = useState(false); const city = String(row?.city || "").toLowerCase().trim(); const [timeframe, setTimeframe] = useState<"1D" | "3D">("1D"); const [userToggledKeys, setUserToggledKeys] = useState>({}); @@ -1181,12 +1179,10 @@ export function LiveTemperatureThresholdChart({ if (cached && Date.now() - cached.ts < HOURLY_CACHE_TTL_MS) { setHourly(cached.data); - setIsFetching(false); return; } setHourly(seedHourlyForecastFromRow(row)); - setIsFetching(true); let cancelled = false; // Prioritize active slots, stagger/delay background slots to optimize load performance @@ -1197,11 +1193,8 @@ export function LiveTemperatureThresholdChart({ .then((data) => { if (cancelled || !data) return; setHourly(data); - setIsFetching(false); }) - .catch(() => { - if (!cancelled) setIsFetching(false); - }); + .catch(() => {}); }, delay); return () => { @@ -1488,16 +1481,7 @@ export function LiveTemperatureThresholdChart({ ); return ( - - {isFetching && ( -
- -
- )} +
{/* Compact stats bar */} {compact ? (