Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Prevent balance from being fetched twice on startup #190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

steveluscher
Copy link

@steveluscher steveluscher commented Dec 11, 2021

Description

Right now, we fetch the wallet balance twice on startup.

This is because of the way we've configured the effect that fetches the wallet balance on startup. It re-runs whenever anything in wallet changes, even though we only need the publicKey to be able to fetch the balance.

In this pull request, we modify the dependencies array so that the only thing that can cause this effect to re-run, is a change in the publicKey.

Type of change

  • Bug fix

How Has This Been Tested?

Loaded the mint site locally, and noticed that now we only call the getBalance API once.

@steveluscher
Copy link
Author

There's a related PR in the wallet adapter repo that should help reduce re-renders of this application even more: anza-xyz/wallet-adapter#193

@jordaaash
Copy link
Contributor

That PR has been merged and released :)

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.

2 participants