fix: resolve CashFlowForecast infinite re-render and auth token key - #639
Open
Ranjeet2063 wants to merge 1 commit into
Open
Ranjeet2063 wants to merge 1 commit into
Ranjeet2063 wants to merge 1 commit into
Conversation
- Remove auto-fetching `useEffect` that was triggering an infinite render loop (due to `params` in `loadForecast` deps) and showing an immediate error toast on mount - Update API service to read the bearer token from `payd_auth_token` instead of the non-existent `accessToken` key Closes Protocol-Guild#542
Ranjeet2063
force-pushed
the
fix/cash-flow-auth-542
branch
from
October 2, 2026 19:41
2d6be8c to
b1f51a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the broken
CashFlowForecastpage by resolving the infinite re-render loop on mount and ensuring API requests send the correct authorization token.Changes
useEffectblock that was blindly callingloadForecast()on mount. BecauseloadForecastdepends onparams(which update on every keystroke), the effect was triggering an infinite render loop and showing a spurious error toast immediately before the user could enter anything.cashFlowForecastApi.tsto correctly read the bearer token fromlocalStorage.getItem('payd_auth_token')instead of the non-existentaccessTokenkey. API calls now authenticate properly instead of failing with 401 Unauthorized.Closes #542