Skip to content

Refactor wallet & farming screens#817

Merged
zaelgohary merged 8 commits intodevelopmentfrom
development_refactor_wallet_provider
Dec 29, 2024
Merged

Refactor wallet & farming screens#817
zaelgohary merged 8 commits intodevelopmentfrom
development_refactor_wallet_provider

Conversation

@zaelgohary
Copy link
Copy Markdown
Contributor

@zaelgohary zaelgohary commented Dec 23, 2024

Changes

  • List wallets in the Wallet provider constructor
  • Add a flag to check if wallets have been listed before starting listing
  • Exclude repeated wallets from PKID wallets,
  • Wait for all futures at once
  • List farms only if wallets are listed

Related Issues

Tested Scenarios

  • Navigate to wallet then Farming
  • Navigate to Farming then wallets

Copy link
Copy Markdown
Contributor

@AlaaElattar AlaaElattar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job, The wallet section is a lot faster than before. 🚀

Copy link
Copy Markdown
Contributor

@AhmedHanafy725 AhmedHanafy725 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +40 to +43
Set<String> walletsSet = {};
final filteredWallets =
pkidWallets.where((p) => walletsSet.add(p.seed)).toList();
return filteredWallets;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also make sure that the seed is not repeated when adding the wallet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the user wants to add existing wallet with a diff name?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not allowed. There is a validation while importing the wallet, but the daily wallet is added in a different way


await Future.wait(twinIdFutures);

farms = await getFarmsByTwinIds(twinIdWallets.keys.toList());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

farms that have up nodes should be only able to vote

AhmedHanafy725
AhmedHanafy725 previously approved these changes Dec 29, 2024
loading = true;
});
farms.clear();
final wallets = ref.read(walletsNotifier);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to wait till the wallets are listed before fetching them

@zaelgohary zaelgohary merged commit 7a30692 into development Dec 29, 2024
@zaelgohary zaelgohary deleted the development_refactor_wallet_provider branch December 29, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants