cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos ⚛️
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
182 stars 132 forks source link

Have to click multiple times on Keplr modal to add a chain #347

Open dillu24 opened 1 year ago

dillu24 commented 1 year ago

Description

Let’s say I connect to Cosmos Hub Testnet and Osmosis Testnet using Cosmos kit. If I remove the Osmosis Testnet from Keplr and refresh my UI I expect that WalletClient.connect should trigger an addChain on my UI and hence Keplr asks me to add Osmosis Testnet to Keplr.

The Keplr modal is triggered successfully, however, I’d have to click multiple times on Approve to close it and I’d get “osmo-test-5 already added” errors in my console.

Note: This also happens if I use addChain directly.

Cosmos Kit version: Latest v1, but this also occurred on latest Cosmos Kit v2.

dillu24 commented 1 year ago

Hey @twhy were you successful in trying to replicate this issue yet?

twhy commented 1 year ago

@dillu24 Have you tried use useChains hook ? https://docs.cosmoskit.com/hooks/use-chains It would be better if you can provide a repo and reproduce steps. Or make a small Loom https://www.loom.com/looms/videos video to show the issue.

dillu24 commented 1 year ago

Hey @twhy . We have a slack channel with you guys, is it possible to message you there with more details? We got a channel with @liujun93 .

twhy commented 1 year ago

@dillu24 Yes. You can message us more details on this on Slack