Skip to content

feat: surface isFreighterInstalled in the UI [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #1

Open
waterWang wants to merge 1 commit into
mergemint-mint:mainfrom
waterWang:feat/surface-freighter-installed
Open

feat: surface isFreighterInstalled in the UI [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]#1
waterWang wants to merge 1 commit into
mergemint-mint:mainfrom
waterWang:feat/surface-freighter-installed

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Surface isFreighterInstalled() in the UI so users without the Freighter browser extension get a clear install prompt instead of a raw error from freighter.requestAccess().

Changes

src/lib/WalletContext.tsx

  • Import isFreighterInstalled from ./wallet
  • Check extension availability on mount via useEffect
  • Expose freighterInstalled in the context state
  • Guard connect() with an early return when Freighter is not detected

src/components/WalletConnectButton.tsx

  • Show "Install Freighter" link (pointing to Chrome Web Store) when the extension is not detected
  • Show normal "Connect Freighter" button only when Freighter is available

Behavior

State Before After
Freighter not installed Generic error from requestAccess() "Install Freighter" link with Chrome Web Store URL
Freighter installed Normal connect flow Unchanged
Wallet connected Shows shortened address Unchanged

Closes #494

Check wallet extension availability on mount and show an install prompt
when Freighter is not detected, instead of showing a generic connect
button that fails with a raw error message.

Closes #494
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