Skip to content

Conversation

@MatiasOS
Copy link
Member

Description

Fix state synchronization issue in Settings page where Alchemy and Infura provider badges don't display immediately after saving API keys configuration.

Related Issue

Closes #177

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • Added useEffect hook to synchronize localRpc state when rpcUrls context changes
  • The localRpc state was initialized once at mount from context but never updated when context changed after save
  • Now badges appear immediately after clicking "Save Configuration" without requiring navigation

Screenshots (if applicable)

N/A - Behavior fix, no visual changes

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

Root cause: The Settings component's localRpc state was a one-time snapshot of rpcUrls from AppContext. When save() updated the context via setRpcUrls(parsed), localRpc was never synchronized. The RPC list rendered from stale localRpc, so badges didn't appear until the component remounted on navigation.

@github-actions
Copy link

🚀 Preview: https://pr-179--openscan.netlify.app
📝 Commit: 7568057c82a4966649a8e3aa22d9d079dda14b89

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant