From 5e0dc3ec53ad727fca104b4299c0412d19824b83 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Fri, 22 May 2026 04:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=A7=BB=E9=99=A4=E5=8F=AF=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E5=9F=8E=E5=B8=82=E8=BF=87=E6=BB=A4=EF=BC=8C=E5=A7=8B=E7=BB=88?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=85=A8=E9=83=A8=E7=9B=91=E6=B5=8B=E5=9F=8E?= =?UTF-8?q?=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Constraint: MobileCityPicker 数据源仅使用 store.cities Scope-risk: 仅影响 cityListRows 构建逻辑 --- .../dashboard/ScanTerminalDashboard.tsx | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/frontend/components/dashboard/ScanTerminalDashboard.tsx b/frontend/components/dashboard/ScanTerminalDashboard.tsx index bd3c7140..ef6032c7 100644 --- a/frontend/components/dashboard/ScanTerminalDashboard.tsx +++ b/frontend/components/dashboard/ScanTerminalDashboard.tsx @@ -128,42 +128,43 @@ function ScanTerminalScreen() { [terminalData?.rows], ); - const cityListRows = useMemo(() => { - if (timeSortedRows.length > 0) return timeSortedRows; - return store.cities.map((city, index) => { - const cityKey = normalizeCityKey(city.name); - const summary = - store.citySummariesByName[cityKey] ?? - Object.values(store.citySummariesByName).find( - (s) => normalizeCityKey(s?.name) === cityKey, - ) ?? - null; - return { - id: `city-fallback:${cityKey}:${index}`, - city: cityKey, - city_display_name: city.display_name || city.name, - display_name: city.display_name || city.name, - temp_symbol: city.temp_unit === "fahrenheit" ? "°F" : "°C", - current_temp: summary?.current?.temp ?? null, - current_max_so_far: summary?.current?.temp ?? null, - deb_prediction: summary?.deb?.prediction ?? null, - airport: city.airport || null, - local_time: summary?.local_time ?? null, - risk_level: city.risk_level || "low", - market_slug: null, - market_question: null, - target_label: null, - side: null, - edge_percent: null, - final_score: null, - window_phase: null, - tradable: false, - active: false, - closed: false, - accepting_orders: false, - } satisfies ScanOpportunityRow; - }); - }, [timeSortedRows, store.cities, store.citySummariesByName]); + const cityListRows = useMemo( + () => + store.cities.map((city, index) => { + const cityKey = normalizeCityKey(city.name); + const summary = + store.citySummariesByName[cityKey] ?? + Object.values(store.citySummariesByName).find( + (s) => normalizeCityKey(s?.name) === cityKey, + ) ?? + null; + return { + id: `city-fallback:${cityKey}:${index}`, + city: cityKey, + city_display_name: city.display_name || city.name, + display_name: city.display_name || city.name, + temp_symbol: city.temp_unit === "fahrenheit" ? "°F" : "°C", + current_temp: summary?.current?.temp ?? null, + current_max_so_far: summary?.current?.temp ?? null, + deb_prediction: summary?.deb?.prediction ?? null, + airport: city.airport || null, + local_time: summary?.local_time ?? null, + risk_level: city.risk_level || "low", + market_slug: null, + market_question: null, + target_label: null, + side: null, + edge_percent: null, + final_score: null, + window_phase: null, + tradable: false, + active: false, + closed: false, + accepting_orders: false, + } satisfies ScanOpportunityRow; + }), + [store.cities, store.citySummariesByName], + ); const { addAiPinnedCity, aiPinnedCities,