From 374c155aaa22226db58f03f2eca4de7dc81b4a29 Mon Sep 17 00:00:00 2001 From: waterWang <672684719@qq.com> Date: Fri, 21 Aug 2026 02:15:47 +0800 Subject: [PATCH] fix: correct auth token key and remove mount error toast in CashFlowForecast - `cashFlowForecastApi.ts`: replace `localStorage.getItem('accessToken')` with `localStorage.getItem('payd_auth_token')` in all 4 API functions (getForecast, getHistoricalData, getProjections, getAlerts). Auth stores the token as `payd_auth_token` per `utils/api.ts`, so API calls were sending empty bearer tokens causing 401 errors. - `CashFlowForecast.tsx`: remove `notifyError` call when params are empty on mount. The page was showing an immediate error toast on load before the user had a chance to enter distributionAccount/assetIssuer. Closes #542 --- frontend/src/pages/CashFlowForecast.tsx | 1 - frontend/src/services/cashFlowForecastApi.ts | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/CashFlowForecast.tsx b/frontend/src/pages/CashFlowForecast.tsx index f83a9209..d07869d6 100644 --- a/frontend/src/pages/CashFlowForecast.tsx +++ b/frontend/src/pages/CashFlowForecast.tsx @@ -51,7 +51,6 @@ export default function CashFlowForecast() { const loadForecast = useCallback(async () => { if (!params.distributionAccount || !params.assetIssuer) { - notifyError('Please provide distribution account and asset issuer'); return; } diff --git a/frontend/src/services/cashFlowForecastApi.ts b/frontend/src/services/cashFlowForecastApi.ts index 9ccef1e1..da7d6920 100644 --- a/frontend/src/services/cashFlowForecastApi.ts +++ b/frontend/src/services/cashFlowForecastApi.ts @@ -105,7 +105,7 @@ export const getForecast = async (params: ForecastParams): Promise