Avoid blocking city details while pro access is loading

This commit is contained in:
2569718930@qq.com
2026-04-10 08:16:15 +08:00
parent a5eff0031c
commit 150c793b35
+17 -1
View File
@@ -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 }));