Skip to content

refactor(frontend): decouple wallet logic into useWalletManager hook#539

Open
Mosas2000 wants to merge 4 commits intoGildado:mainfrom
Mosas2000:fix-127-refactor-usewallet
Open

refactor(frontend): decouple wallet logic into useWalletManager hook#539
Mosas2000 wants to merge 4 commits intoGildado:mainfrom
Mosas2000:fix-127-refactor-usewallet

Conversation

@Mosas2000
Copy link
Copy Markdown

I have completed the refactoring of the useWallet hook logic as requested for this issue

I decoupled the wallet connection and state management into a clean, new custom hook called useWalletManager.ts, while stripping out the logic from WalletProvider.tsx so it acts only as a pure UI and context wrapper. I also identified and fixed a subtle memory leak in the timeout mechanism.

Fully automated tests were added for the new hook structure and they are passing reliably.

Closes #401

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@Mosas2000 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Mosas2000 and others added 3 commits April 3, 2026 11:52
Resolve conflict in WalletProvider.tsx by keeping the refactored
useWalletManager hook approach while incorporating upstream
accessibility improvements (modal title ID and aria attributes).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace 'any' type with properly typed MockKitInstance interface
- Fix floating promises by properly awaiting async operations
- Remove unused MockedFunction import
- Use vi.mocked() for cleaner mock implementations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

#127: Refactor useWallet Hook for Better Reusability

1 participant