Show syncing state while loading city snapshot

This commit is contained in:
2569718930@qq.com
2026-04-08 20:22:32 +08:00
parent 4316f42a68
commit 799abd71b0
2 changed files with 22 additions and 3 deletions
+7 -1
View File
@@ -588,6 +588,7 @@ export function DashboardStoreProvider({
}
const access = proAccessRef.current;
if (!access.authenticated || !access.subscriptionActive) {
setLoadingState((current) => ({ ...current, cityDetail: true }));
if (!citySummariesRef.current[cityName]) {
try {
const summary = await dashboardClient.getCitySummary(cityName);
@@ -595,7 +596,12 @@ export function DashboardStoreProvider({
...current,
[cityName]: summary,
}));
} catch {}
} catch {
} finally {
setLoadingState((current) => ({ ...current, cityDetail: false }));
}
} else {
setLoadingState((current) => ({ ...current, cityDetail: false }));
}
return;
}