Skip to content

fix: auto-switch wallet to Gnosis Chain + fix Vite dev CORS#49

Open
crtahlin wants to merge 1 commit into
GasperX93:feat/add-swarm-notifyfrom
crtahlin:feat/add-swarm-notify
Open

fix: auto-switch wallet to Gnosis Chain + fix Vite dev CORS#49
crtahlin wants to merge 1 commit into
GasperX93:feat/add-swarm-notifyfrom
crtahlin:feat/add-swarm-notify

Conversation

@crtahlin

Copy link
Copy Markdown
Collaborator

Summary

Two issues discovered during Phase 1a smoke testing:

  1. Wallet defaults to mainnet on connect — reorder wagmi chains so Gnosis is first, add auto-switch via useSwitchChain in Layout when wallet is on wrong network
  2. Port 3002 shows Bee node as "off" — Vite dev server can't reach Bee API at localhost:1633 due to CORS. Add ui/.env.development to route through the existing Vite proxy (/bee-api/*)

Also updates the Phase 1a testing doc with proxy setup instructions.

Closes #48

Changed files

File Change
ui/src/wagmi.ts Reorder chains to [gnosis, mainnet]
ui/src/components/Layout.tsx Add useAccount + useSwitchChain + auto-switch effect
ui/.env.development New: VITE_BEE_API_URL=/bee-api
docs/testing/phase-1a-swarm-notify.md Add proxy setup section

AI-assisted implementation.

- Reorder wagmi chains to [gnosis, mainnet] so Gnosis is the default
- Add useEffect in Layout to auto-switch chain when wallet is on wrong network
- Add ui/.env.development with VITE_BEE_API_URL=/bee-api so the Vite dev
  server proxies Bee API calls (fixes CORS issue showing node as "off"
  on port 3002)
- Update Phase 1a testing doc with proxy setup instructions

Closes GasperX93#48

AI-assisted implementation.
@crtahlin crtahlin requested a review from GasperX93 as a code owner April 21, 2026 14:18
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