Replies: 3 comments
-
Personally, I really like the behavior in 1C that switches to the dapp's current network. I think this should be the default behavior in that instance. I haven't worked on an app that supports multiple chains so I don't have that much opinion on the other matters. I do think that if a user switches chains in the middle of using an app then they are kind of asking for undefined behavior and I don't do a ton to support this small subset. |
Beta Was this translation helpful? Give feedback.
-
Thanks for writing this up! I'm currently building a multichain dapp on https://strigo.fi/ 1B changing is my main request. Please don't change the network if it's still a supported one. I would also prefer if 1C didn't change the network. If we were a Celo-only dapp it would make sense to want to change the network to Celo, but being a multichain dapp which network do you switch to? The current behavior is switching to Celo (my dapp supports both Celo and Polygon), but I would prefer to simply show a "Network not supported" message and let the user choose which network they want to use. Choosing for them is not ideal. In any case, even if you don't want to change the default behavior I would really appreciate an option to turn off all automatic network changes. ie Only change the network if I explicitly call |
Beta Was this translation helpful? Give feedback.
-
gone ahead with the opt into no magic mode #303 |
Beta Was this translation helpful? Give feedback.
-
There are a few behaviors at the convergence of the wallet's chain and the dapp supported chains that Im realizing we dont handle well yet.
Cases
at initial load
A) if the wallet network matches dapp's current network
B) if the wallet network does not match dapp's current but does match one in networks array
C) if the wallet network does not match dapp's current and does NOT match any supported by dapp (is not in networks array)
when the wallet switches networks
A) To one supported by dapp (is in networks array)
B) to one Not supported by dapp (is not in networks array)
Behaviors as is
1A -- nothing to be done
1B -- currently prefers the dapps network so switches wallet to that
1C -- currently prefers the dapps network so switches wallet to that
2A -- swtiches dapp to that network
2B -- logs that it did not switch (now wallet is on a different network than dapp)
potential specifications and changes
@gnardini recently wrote in discord a request for a change in behavior (opt in) for cases 1B and 1C (github related issue here)
In case 1B react-celo would not look at default network or last used network and instead initialize with whichever chain id the wallet returned (provided it supported)
query
The question becomes what happens in cases 1C and 2B where the wallet is on or switched to a chain that the dapp does not support?
Some options
useCelo
hook) and devs can choose to do something if it doesnt matchmy thoughts.
There are two things we are looking at here.
I) changing behavior around precedence of config vs wallet network, and
II) defining behavior where none really exists around wallets on unsupported networks.
Id prefer not to have too many different behaviors going on. IE initial load and network switch should behave the same.
Beta Was this translation helpful? Give feedback.
All reactions