fix: cleanup useQuoteQuery and remove stray console.log#217
Conversation
- Fix typo: 'conver' → 'convert' in error message - Remove unused import (keepPreviousData) - Fix code formatting and spacing - Remove console.log from Form.tsx error handler - Add TODO comment for hardcoded excludeRouters
|
Someone is attempting to deploy a commit to the wowcats Team on Vercel. A member of the Team first needs to authorize it. |
Previously, when excludeDexes was specified, the plugin would always add a hardcoded list of excludeRouters. This was undocumented and couldn't be overridden. Changes: - Add excludeRouters to FormProps interface with documentation - Only apply default excludeRouters if user doesn't specify their own - Extract default routers to named constant for clarity - Fix typo and remove unused import (from PR jup-ag#217) Users can now: 1. Use excludeDexes alone (gets default router exclusions) 2. Use excludeRouters alone (explicit control) 3. Use both for full control 4. Pass empty excludeRouters=[] to opt out of default behavior
thejesh23
left a comment
There was a problem hiding this comment.
Mostly low-risk cleanups, but worth scrutinizing the empty catch in Form.tsx: replacing the console.log with a comment-only catch quietly swallows errors and relies on the runtime invariant that the mutation always sets setLastSwapResult before throwing — that isn't enforced by types and will rot silently if a future refactor changes it. Safer to either let the error propagate (throw error or remove the try/catch) or keep a real logged side-effect (console.error gated on dev). Empty catch with a justification comment looks intentional in git blame but is the riskiest of the three options. Rest of the cleanup (typo fix, unused keepPreviousData import, formatting) looks fine.
Summary
This PR cleans up minor issues in the codebase:
Changes
'conver'→'convert'in superstruct error messagekeepPreviousDatawas imported but never usedconsole.log('Swap error', error)from Form.tsxexcludeRoutersarray for future considerationFiles Changed
src/queries/useQuoteQuery.tssrc/components/Form.tsxTesting