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: Turn off SWR automatic revalidation when window is focused #3129

Merged
merged 1 commit into from Apr 7, 2024

Conversation

Mxtzz
Copy link
Contributor

@Mxtzz Mxtzz commented Apr 7, 2024

Description

Issues#3048 Why do we always trigger many requests every time we focus on the page ?

if using SWR to process data requests in React, set revalidateOnFocus=false in config is better.

Fixes #3048

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  1. Open any page
  2. Blur the page
  3. Focus the page
  4. See the network in browser's console

The network page of console is very refreshing

  • TODO

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. ☕️ javascript Pull requests that update Javascript code 🐞 bug Something isn't working labels Apr 7, 2024
@takatost takatost requested a review from zxhlyh April 7, 2024 07:18
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 7, 2024
@crazywoola crazywoola merged commit 5a23d57 into langgenius:main Apr 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ☕️ javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What happened to the explore tab?
3 participants