Closed jellegerbrandy closed 5 years ago
Alchemy used to only update some parts when account changed but there kept being edge cases that we missed so thats why we decided to just reload... we can try again but doesnt seem like high priority right now to make this work. people won't change their accounts very often either, only devs
related: #326 and #338
I'm closing this as we have something working now, even if it is not ideal :-)
Alchemy gets its current state from an external provider (metamask for now, portis maybe as well later).
the user can change this while using the app. Alchemy used to reload the entire app when he accountchanges, which seems a bit overkill. Here's a proposal:
(1) quick iteration one: we reload just as alchemy does
(2) ideal behavior:
when network changes: reload entire app. This makes ok bc it will typically never happen (only for devs), and it is good bec it is a kind of warning "you are loading anew app"
when account address changes: only update the components that are affected. To follow the pattern we ahve been using, this would imply implementing an observable
arc.currentAccount
that sends a new account through the pipe when it changes.