argentlabs / argent-x

ArgentX browser extension for StarkNet - made with ❤️ by Argent
https://github.com/argentlabs/argent-x
Other
625 stars 276 forks source link

Switching network to Testnet2 breaks "networkChanged" events #1658

Closed DaveVodrazka closed 1 year ago

DaveVodrazka commented 1 year ago

Description

In the extension wallet, added event listeners via wallets window.starknet_argentX.on("networkChanged", callback) stops working if the network is switched to Testnet 2.

Steps To Reproduce

Expected Outcome

Callback will be still working after switching to Testnet 2 or Devnet and back to Testnet or Mainnet.

Actual Outcome

Callback stops being called.

DaveVodrazka commented 1 year ago

☝️ if you can confirm that this is indeed a bug and not a problem on my side, let me know and I'll make a PR when I get to it 🙂

dhruvkelawala commented 1 year ago

Can you link the dApp that you are trying to use? If the dApp doesn't support TESTNET2, the wallet will be disconnected and therefore won't emit "networkChanged" event.

swiiny commented 1 year ago

Can you link the dApp that you are trying to use? If the dApp doesn't support TESTNET2, the wallet will be disconnected and therefore won't emit "networkChanged" event.

Hey @dhruvkelawala 👋 I'm experiencing a similar issue where accountsChanged and networkChanged are never triggered. I probably missed something but what do you mean by If the dApp doesn't support TESTNET2?

Should we register somewhere which networks can be used?

pei-zklend commented 1 year ago

Has this issue in regards to accountsChanged and networkChanged triggering been resolved?