Skip to content

feat(wallet): detect missing Freighter and show an install prompt - #194

Merged
presidojay1 merged 2 commits into
StellarTickets:mainfrom
laurastephaniee:feat/66-freighter-install-prompt
Sep 26, 2026
Merged

presidojay1 merged 2 commits into
StellarTickets:mainfrom
laurastephaniee:feat/66-freighter-install-prompt

Conversation

@laurastephaniee

@laurastephaniee laurastephaniee commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

isFreighterInstalled() in src/lib/wallet.ts was 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.ts
    • isFreighterInstalled() now never throws. It resolves false when Freighter reports not connected, returns an error, or the extension call rejects. This makes it safe to call on mount.
    • Adds an exported FREIGHTER_INSTALL_URL (https://www.freighter.app/).
  • src/components/wallet-connect-button.tsx
    • Checks for the extension once on mount with useEffect. The effect has a cancellation guard and sits above the early return null, so the order of hooks doesn't change between renders.
    • If Freighter is missing, the Connect button is replaced by an Install Freighter wallet link with a short explanation. The link opens in a new tab with target="_blank" rel="noopener noreferrer".
    • While the check is still running, or when Freighter is found, the existing Connect button behaves exactly as before. Users who already have a connected wallet still see their address.

Commits

  1. feat(wallet): make isFreighterInstalled safe to call on mount: the helper change plus two new tests (an error result, and a call that rejects) in wallet.test.ts.
  2. feat(wallet): show an install prompt when Freighter is missing: the component change.

Testing

I added unit tests for the new isFreighterInstalled branches. They weren't run locally because there's no node_modules in my checkout, so vitest will run them in CI.
Closes #66
Closes #67
Closes #68
Closes #69

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.
@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for stellartickets failed.

Name Link
🔨 Latest commit aa9baf1
🔍 Latest deploy log https://app.netlify.com/projects/stellartickets/deploys/6ab7e1afed13e90008be6f01

@presidojay1
presidojay1 merged commit 5b2254d into StellarTickets:main Sep 26, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants