Open ygrishajev opened 3 months ago
The refactoring is required to be delivered one piece at a time to avoid huge disturbance to the code base and ease code reviews.
The first PR should be just replacing local storage direct access with jotai store.
The following should be replacing non-react usages with react usages where needed. This should be done 1 usage per PR as it will require changing several functions in a call stack, so we need to make sure we can properly review and make sure we're on the same page with the contribution.
hey @hiroyukikumazawa - is this something you'd like to take on? (cc @brewsterdrinkwater to figure out bounty)
yes, I will take this, @anilmurty
This PR introduces a possibility to access network/networkId value uniformly. It also changes how store value is persisted into local storage relying on the jotai native functionality. At this point nowhere else in the app should persistence should be managed or exposed. There are still a bunch of places where components or other entities are reading the value from local storage making it less maintainable. It also affects UX as we're forced to reload the page after network change. We need to refactor all the clients relying on the same store and also make sure we rely on proper functionality depending on whether we're in or out react context.