Skip to content

Improve Solana wallet detection typing and lint cleanliness#3

Open
aster2333 wants to merge 6 commits into
mainfrom
codex/fix-payment-login-issue
Open

Improve Solana wallet detection typing and lint cleanliness#3
aster2333 wants to merge 6 commits into
mainfrom
codex/fix-payment-login-issue

Conversation

@aster2333

Copy link
Copy Markdown
Owner

Summary

  • add explicit types for legacy Solana extension detection so eslint no-explicit-any is satisfied
  • reuse the typed detection inside the enhanced wallet button instead of any-casting window objects
  • clean up remaining lint errors by replacing an empty interface and removing an unused import

Testing

  • npm run lint

https://chatgpt.com/codex/tasks/task_e_68f891b8611c83268ead0db02e062baa

@vercel

vercel Bot commented Oct 22, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
actionfi Ready Ready Preview Comment Oct 30, 2025 3:35am
challenge-market Ready Ready Preview Comment Oct 30, 2025 3:35am

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/hooks/useWallet.ts Outdated
Comment on lines +66 to +97
balance: balance,
nfts: user?.nfts || []
}

setUser(userData)
updateBalance()
} else {
setUser(null)
setBalance(0)
}
}, [connected, publicKey, setUser, setIsWalletConnected])
}, [balance, isConnected, publicKey, setIsWalletConnected, setUser, updateBalance, user])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid infinite wallet update loop

The useEffect that syncs wallet state now depends on user and balance but also calls setUser and updateBalance on every run. Once a wallet connects, setUser writes a fresh object to the Zustand store, changing the user reference each render. Because user is in the dependency array, the effect immediately fires again and repeats the same state write and balance refresh indefinitely, resulting in constant re-renders and repeated RPC calls whenever a wallet is connected. The pre-commit version did not include user/balance in the dependencies, so this loop is newly introduced.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant