added soloana on UI for testing - #12
jasspreetbawa13 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
React Doctor found 8 new issues in 8 files · 8 warnings · score 86 / 100 (Great) · 6 fixed · vs 8 warnings
Reviewed by React Doctor for commit |
| } | ||
|
|
||
| const controller = new AbortController(); | ||
| void fetch(rpcUrl, { |
There was a problem hiding this comment.
React Doctor · react-doctor/no-fetch-response-used-without-status-check (warning)
fetch() resolves (does not reject) on HTTP 4xx/5xx, so this unchecked body read may treat an HTTP error payload like a successful response. Check response.ok/response.status, or deliberately handle the API's error payload, before reading the body.
Fix → Check response.ok (or response.status) before consuming a fetch Response with .json()/.text()/.blob(). fetch resolves on HTTP 4xx/5xx, so an unchecked response parses the error body as success or crashes on an always-truthy guard.
| onConnectSolana?: () => void; | ||
| } | ||
|
|
||
| export function EarnFlowPanel({ |
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
EarnFlowPanel has cyclomatic complexity 21, cognitive complexity 33, and maximum nesting depth 4, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
| @@ -33,7 +33,14 @@ const CTA_TONE_CLASSES: Record<PaySwapCtaTone, string> = { | |||
| * and the SDK wiring; this file decides what the user sees. | |||
| */ | |||
| export function PaySwapIntentWidget(props: PaySwapIntentWidgetProps) { | |||
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
PaySwapIntentWidget has cyclomatic complexity 27, cognitive complexity 25, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
| @@ -100,14 +114,16 @@ export interface PaySwapEngine { | |||
| * Takes the widget's props whole so the component isn't a forty-line | |||
| * destructure before it can render anything. | |||
| */ | |||
| export function usePaySwapEngine(props: PaySwapIntentWidgetProps): PaySwapEngine { | |||
| export function usePaySwapEngine( | |||
There was a problem hiding this comment.
React Doctor · react-doctor/no-high-complexity-react-function (warning)
usePaySwapEngine has cyclomatic complexity 60, cognitive complexity 38, and maximum nesting depth 2, so its React logic is hard to understand and change. Extract independent branches into components or hooks.
Fix → Extract independent render branches and state logic into focused components or hooks until the control flow is easy to follow.
No description provided.