Refactor wallet & farming screens#817
Conversation
…wallets, wait for all futures at once
AlaaElattar
left a comment
There was a problem hiding this comment.
Great Job, The wallet section is a lot faster than before. 🚀
There was a problem hiding this comment.
The initial loading is still slow, but it's a good approach to minimize the following loading.
Also, I'm thinking of triggering this once the home page is loaded which will minimize the initial loading.
Can you check the farm loading in the DAO vote? or have an issue to enhance it too
app/lib/services/wallet_service.dart
Outdated
| Set<String> walletsSet = {}; | ||
| final filteredWallets = | ||
| pkidWallets.where((p) => walletsSet.add(p.seed)).toList(); | ||
| return filteredWallets; |
There was a problem hiding this comment.
please also make sure that the seed is not repeated when adding the wallet
There was a problem hiding this comment.
What if the user wants to add existing wallet with a diff name?
There was a problem hiding this comment.
This is not allowed. There is a validation while importing the wallet, but the daily wallet is added in a different way
app/lib/widgets/dao/vote_dialog.dart
Outdated
|
|
||
| await Future.wait(twinIdFutures); | ||
|
|
||
| farms = await getFarmsByTwinIds(twinIdWallets.keys.toList()); |
There was a problem hiding this comment.
farms that have up nodes should be only able to vote
| loading = true; | ||
| }); | ||
| farms.clear(); | ||
| final wallets = ref.read(walletsNotifier); |
There was a problem hiding this comment.
you have to wait till the wallets are listed before fetching them
Changes
Related Issues
Tested Scenarios