Skip to content

Conversation

@tafaust
Copy link
Contributor

@tafaust tafaust commented Oct 15, 2025

  • Added refetchOnWindowFocus: false to the query client configuration to prevent data refetching when switching tabs, enhancing user experience by avoiding unintended form resets.

Fixes #161

- Added `refetchOnWindowFocus: false` to the query client configuration to prevent data refetching when switching tabs, enhancing user experience by avoiding unintended form resets.
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.90%. Comparing base (12cb83e) to head (d4d40dd).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   19.90%   19.90%           
=======================================
  Files         181      181           
  Lines       18829    18829           
=======================================
  Hits         3748     3748           
  Misses      14897    14897           
  Partials      184      184           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

queries: {
retry: false,
staleTime: 1000 * 60 * 5, // 5 minutes
refetchOnWindowFocus: false, // Prevent refetch when switching tabs to avoid form resets
Copy link
Owner

Choose a reason for hiding this comment

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

I would actually like to keep it as before, I think this is good thing to sync data on focus in background. I believe the issue we really need to fix is in the apps/web/src/hooks/useCheckCustomDomain.ts.

Adding this line fix screen blinking and rerendering whole app.

  const {
    data: customDomain,
    isLoading: isCustomDomainLoading,
    isFetched,
  } = useQuery({
    ...getStatusPagesDomainByDomainOptions({
      path: {
        domain,
      },
    }),
    refetchOnWindowFocus: false, // <- here
  });

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.

Switching tab reset name

2 participants