feat(wallet): add reconnect prompt with persisted last-used provider#676
Open
Codekill33 wants to merge 1 commit into
Open
feat(wallet): add reconnect prompt with persisted last-used provider#676Codekill33 wants to merge 1 commit into
Codekill33 wants to merge 1 commit into
Conversation
|
@Codekill33 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Returning users currently land on a disconnected state with no guidance on how to reconnect quickly. This PR introduces a lightweight reconnect prompt that reads the last-used wallet provider from localStorage, validates it is still available in the injected provider list, and surfaces a one-click reconnect banner on app load. Dismissed state is tracked per session so the prompt does not reappear on the same visit after the user manually closes it.
Changes
Persist last-used provider key to
localStorage
on successful wallet connection
Read and validate persisted provider against currently injected providers on app load
Show
ReconnectPrompt
banner when disconnected and a valid last-used provider exists
Graceful fallback to full wallet selector when provider is unavailable or uninstalled
Track dismiss state in
sessionStorage
— prompt does not re-show after dismissal within the same tab session
Files changed
src/hooks/useWalletPersistence.ts
new
src/components/ReconnectPrompt.tsx
new
src/components/ReconnectPrompt.test.tsx
new
src/hooks/useWalletPersistence.test.ts
new
src/context/WalletContext.tsx
modified
src/App.tsx
modified
Testing
Prompt appears when disconnected and a valid provider is stored
Prompt does not appear when no provider is persisted
Prompt does not appear when stored provider is no longer injected
Dismiss hides prompt and sets session flag; prompt does not re-render on same session
Clicking reconnect triggers wallet connection with the stored provider
Fallback to full wallet selector renders correctly for unavailable provider
closes #487