From 150c793b35c3ee7b02409c86360b264cb090176d Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Fri, 10 Apr 2026 08:16:15 +0800 Subject: [PATCH] Avoid blocking city details while pro access is loading --- frontend/hooks/useDashboardStore.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/hooks/useDashboardStore.tsx b/frontend/hooks/useDashboardStore.tsx index be421f17..fffbfe53 100644 --- a/frontend/hooks/useDashboardStore.tsx +++ b/frontend/hooks/useDashboardStore.tsx @@ -584,8 +584,24 @@ export function DashboardStoreProvider({ setFutureModalDate(null); if (proAccessRef.current.loading) { - await refreshProAccess(); + setLoadingState((current) => ({ ...current, cityDetail: true })); + if (!citySummariesRef.current[cityName]) { + try { + const summary = await dashboardClient.getCitySummary(cityName); + setCitySummariesByName((current) => ({ + ...current, + [cityName]: summary, + })); + } catch { + } finally { + setLoadingState((current) => ({ ...current, cityDetail: false })); + } + } else { + setLoadingState((current) => ({ ...current, cityDetail: false })); + } + return; } + const access = proAccessRef.current; if (!access.authenticated || !access.subscriptionActive) { setLoadingState((current) => ({ ...current, cityDetail: true }));