safe-wallet-web icon indicating copy to clipboard operation
safe-wallet-web copied to clipboard

Display a Switch Network button if wallet is connected to a different chain

Open usame-algan opened this issue 9 months ago • 0 comments

What is the feature about

The connected wallet needs to be on the same network as the safe in order for the user to sign/execute transactions. The current implementation to ensure this consists of multiple parts:

  • We display a WrongChainWarning in some transaction modals
  • We call assertWalletChain in some dispatch functions

This approach is not consistent e.g. we don't call assertWalletChain when creating a safe apps transactions and its easy to miss when adding a new feature. Another issue is that we combine switching the chain and executing/signing a transaction. While this "saves" the user a click, it can also be confusing if one click leads to the wallet popping up twice.

The list of requirements

Ideally, we would have this in one place like CheckWallet and don't show a warning at all but instead show a different button than the action button to prompt the user to switch their network.

Designs/sketches

Screenshot 2024-05-24 at 13 03 23

usame-algan avatar May 24 '24 11:05 usame-algan