Fix: Refresh balance immediately after starting the app for the first time and when adding a new account #1654
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the kind of hacky balance watchdog we had implemented. The reason is that it was for some reason very slow to update, and that showing the notifications of incoming balance diffs was broken anyhow since some flutter update. I suggest re-introducing this notification with the indexer instead, such that we can actually show incoming transfers instead of incoming balance diffs, #1656. Also, this fixes the jumping balance after a network switch. Closes #1530.
I integrated the periodic update of the encointer balance into the overall state update. As the balance update is now blazingly fast, I simplified the getter to only fetch the balance for the currently chosen community instead of getting the non-zero balances of all communities. This removed quite some complexity o f the callback function. However, we might want to integrate the RPC to get all balances in another way: #1655