feat: implement history and future forecast modals, alongside a new Pro feature paywall component.

This commit is contained in:
2569718930@qq.com
2026-03-13 07:56:20 +08:00
parent 5c3de0dbe0
commit a5948a35d4
7 changed files with 709 additions and 617 deletions
+8 -1
View File
@@ -75,6 +75,7 @@ function getInitialProAccessState(): ProAccessState {
loading: true,
authenticated: false,
subscriptionActive: false,
points: 0,
error: null,
};
}
@@ -235,7 +236,10 @@ export function DashboardStoreProvider({
? cityDetailsByName[selectedCity] || null
: null;
const selectedMarketDate =
futureModalDate || selectedForecastDate || selectedDetail?.local_date || null;
futureModalDate ||
selectedForecastDate ||
selectedDetail?.local_date ||
null;
const selectedMarketScanKey = selectedCity
? getMarketScanCacheKey(selectedCity, selectedMarketDate)
: null;
@@ -402,11 +406,13 @@ export function DashboardStoreProvider({
const payload = (await response.json()) as {
authenticated?: boolean;
subscription_active?: boolean | null;
points?: number;
};
setProAccess({
loading: false,
authenticated: Boolean(payload.authenticated),
subscriptionActive: payload.subscription_active === true,
points: payload.points ?? 0,
error: null,
});
} catch (error) {
@@ -414,6 +420,7 @@ export function DashboardStoreProvider({
loading: false,
authenticated: false,
subscriptionActive: false,
points: 0,
error: String(error),
});
}