feat(wallet): detect missing Freighter and show an install prompt - #194
Merged
presidojay1 merged 2 commits intoSep 26, 2026
Merged
presidojay1 merged 2 commits into
presidojay1 merged 2 commits into
Conversation
Never throws: resolves false when the extension is missing, reports an error, or the call rejects. Exports FREIGHTER_INSTALL_URL.
WalletConnectButton checks for the extension on mount and, if absent, renders an 'Install Freighter wallet' link (new tab, noopener noreferrer) instead of a Connect button that can only fail.
|
@laurastephaniee 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! 🚀 |
❌ Deploy Preview for stellartickets failed.
|
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.
Problem
isFreighterInstalled()insrc/lib/wallet.tswas exported but never called. A user without the Freighter extension only found out after clicking Connect Freighter wallet, when they got the generic error "Could not connect your wallet. Is Freighter installed?".Fix
src/lib/wallet.tsisFreighterInstalled()now never throws. It resolvesfalsewhen Freighter reports not connected, returns anerror, or the extension call rejects. This makes it safe to call on mount.FREIGHTER_INSTALL_URL(https://www.freighter.app/).src/components/wallet-connect-button.tsxuseEffect. The effect has a cancellation guard and sits above the earlyreturn null, so the order of hooks doesn't change between renders.target="_blank" rel="noopener noreferrer".Commits
feat(wallet): make isFreighterInstalled safe to call on mount: the helper change plus two new tests (anerrorresult, and a call that rejects) inwallet.test.ts.feat(wallet): show an install prompt when Freighter is missing: the component change.Testing
I added unit tests for the new
isFreighterInstalledbranches. They weren't run locally because there's nonode_modulesin my checkout, sovitestwill run them in CI.Closes #66
Closes #67
Closes #68
Closes #69