bug: Swap page shows wallet not connected despite wallet being connected in header #7

Closed
opened 2026-03-12 02:48:52 +00:00 by Brouie · 8 comments
Brouie commented 2026-03-12 02:48:52 +00:00 (Migrated from gitlab.com)

Simulated dev wallet shows as connected in the header (address + Disconnect button visible), but the Swap page displays 'Wallet not connected. Please connect your wallet first.' and blocks swap execution.

The wallet connection state is not being shared properly between the header and the swap page component.

Simulated dev wallet shows as connected in the header (address + Disconnect button visible), but the Swap page displays 'Wallet not connected. Please connect your wallet first.' and blocks swap execution. The wallet connection state is not being shared properly between the header and the swap page component.
Brouie commented 2026-03-12 03:25:07 +00:00 (Migrated from gitlab.com)

mentioned in issue #1

mentioned in issue #1
Brouie commented 2026-03-12 04:24:00 +00:00 (Migrated from gitlab.com)

mentioned in issue #8

mentioned in issue #8
PlasticDigits commented 2026-03-12 07:06:34 +00:00 (Migrated from gitlab.com)

Fix committed (see commit on main)

Root cause: The simulated dev wallet path (connectDev) was updating the Zustand store but never registering the MnemonicWallet in the connectedWallets map. The header only checks the store, while the Swap page (and transaction layer) also checks getConnectedWallet(), so they disagreed on connection state.

Fix: Added registerConnectedWallet() in wallet.ts and call it from connectDev() so the dev wallet is registered in the same map used by real wallets. Both the header and Swap page now see the wallet as connected.

@Brouie Could you verify that the Swap page works correctly with the simulated dev wallet?

**Fix committed** (see commit on main) **Root cause:** The simulated dev wallet path (`connectDev`) was updating the Zustand store but never registering the `MnemonicWallet` in the `connectedWallets` map. The header only checks the store, while the Swap page (and transaction layer) also checks `getConnectedWallet()`, so they disagreed on connection state. **Fix:** Added `registerConnectedWallet()` in `wallet.ts` and call it from `connectDev()` so the dev wallet is registered in the same map used by real wallets. Both the header and Swap page now see the wallet as connected. @Brouie Could you verify that the Swap page works correctly with the simulated dev wallet?
PlasticDigits commented 2026-03-12 11:49:15 +00:00 (Migrated from gitlab.com)

mentioned in commit 8b799f5f17

mentioned in commit 8b799f5f170743ef570c3b010174248de176a443
Brouie (Migrated from gitlab.com) closed this issue 2026-03-13 03:01:37 +00:00
Brouie commented 2026-03-13 03:01:39 +00:00 (Migrated from gitlab.com)

Verified fixed — wallet state reaches swap page. Dev added registerConnectedWallet to wallet.ts.

Verified fixed — wallet state reaches swap page. Dev added registerConnectedWallet to wallet.ts.
PlasticDigits commented 2026-05-27 05:37:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #162

mentioned in issue #162
PlasticDigits commented 2026-06-05 04:04:09 +00:00 (Migrated from gitlab.com)

mentioned in merge request !764

mentioned in merge request !764
PlasticDigits commented 2026-06-06 07:15:38 +00:00 (Migrated from gitlab.com)

mentioned in merge request !828

mentioned in merge request !828
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#7
No description provided.