Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

fix: prevent duplicate blockchain state refresh on first load #131

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

onyb
Copy link
Member

@onyb onyb commented Feb 21, 2023

Use debounced version of refreshBlockchainState() and refreshSpotPrices() on first load. This prevents Swap from calling these functions multiple times (due to changing hook dependencies) on initialisation.

The code works with a 0ms debounce, but I don't know why. I tested this PR with console.log statements.

Issue brave/brave-browser#28635

@onyb onyb requested a review from Douglashdaniel February 21, 2023 15:14
@onyb onyb self-assigned this Feb 21, 2023
Copy link
Collaborator

@Douglashdaniel Douglashdaniel left a comment

Choose a reason for hiding this comment

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

++

@onyb onyb merged commit bf12d3d into master Feb 21, 2023
@onyb onyb deleted the optimise-first-load branch February 21, 2023 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants