gnolang / gnonative

Develop for Gno using your app's native language
Apache License 2.0
9 stars 9 forks source link

feat: Change Network #78

Closed iuricmp closed 8 months ago

iuricmp commented 8 months ago

Adds a new capability of selecting and switching networks.

fix #77

iuricmp commented 8 months ago

We need to find a way to get/detect the current selected network.

jefft0 commented 8 months ago

We need to find a way to get/detect the current selected network.

Thanks to another quick review by D4ryl00, PR https://github.com/gnolang/gnomobile/pull/79 is merged to main. You can rebase and use getRemote and getChainID.

jefft0 commented 8 months ago

I re-install the app, then import the jefft0 account. When I click "Change Network", it should the following with two networks "in use". The log has the error " Warning: Encountered two children with the same key, dev. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version." Screenshot 2023-11-21 at 11 00 25

iuricmp commented 8 months ago

I re-install the app, then import the jefft0 account. When I click "Change Network", it should the following with two networks "in use". The log has the error " Warning: Encountered two children with the same key, dev. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version."

Localhost and Berty were using the same chainId so I changed the list to use the index as the UI component id.