Split up initialization action to different stages
Refactor Description
Currently all of the initialization in the app is handled via connect
an action in store/web3/asyncActions
. It handles:
- Detecting web3
- Instantiating event watchers
- Loading state from localstorage
- Fetching data on the network (i.e deployment blocks)
- Getting user balances
Some of these steps depend on each other and can fail or trigger different paths. To handle this properly we should split up these into smaller pieces which are triggered in succession.
Motivation
There are a lot of edge-cases in our loading flow which makes it hard to work with and debug. As the app grows this will only become more difficult. It also allows us to have more complicated loading flows
Implementation
We should have a series of loading components which only render the next one if their loading finishes successfully.
Related Issues/Tasks
- Enables:
- A two stage loading from localStorage to handle visit state and networks (@djudjuu creating an issue once this one is ready to go)