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

Adding polling restart for TokenList Fetch #561

Merged
merged 2 commits into from
Aug 19, 2021
Merged

Conversation

NiranjanaBinoy
Copy link
Contributor

To make sure the TokenList id fetched from the API only when there is a change in chainId or UsestaticTokenList flag specifically and clear all previous polling interval schedules before scheduling a polling interval.

@NiranjanaBinoy NiranjanaBinoy self-assigned this Aug 17, 2021
@NiranjanaBinoy NiranjanaBinoy requested a review from a team as a code owner August 17, 2021 15:42
@danjm
Copy link
Contributor

danjm commented Aug 18, 2021

This looks good. I only have one nitpick: given the name startPolling feels slightly misleading if we are going to stop and the beginning of the call.

Suggestion: create a method called restart :

async start() {
    this.stopPolling();
    await this.startPolling();
  }

Then call this in the network and preference change handlers. And also remove the the stop call in startPolling

danjm
danjm previously approved these changes Aug 18, 2021
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@NiranjanaBinoy NiranjanaBinoy merged commit 1067fd2 into main Aug 19, 2021
@NiranjanaBinoy NiranjanaBinoy deleted the tokenlist-polling branch August 19, 2021 14:42
@adonesky1 adonesky1 mentioned this pull request Aug 27, 2021
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