about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-11-16 15:42:37 -0800
committerGitHub <noreply@github.com>2023-11-16 15:42:37 -0800
commit1952705dedd53041c1bcd39a3a04059ed5236ed6 (patch)
tree2632134b8a7c26632c9403deb372dcf847e9b996 /src
parent6dfb2a232f89e96c6cca25430afecbce50d08a0f (diff)
downloadvoidsky-1952705dedd53041c1bcd39a3a04059ed5236ed6.tar.zst
Disable refetchOnWindowFocus on react-query (#1936)
Diffstat (limited to 'src')
-rw-r--r--src/lib/react-query.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/react-query.ts b/src/lib/react-query.ts
index 2a8f1d759..6b425d3b4 100644
--- a/src/lib/react-query.ts
+++ b/src/lib/react-query.ts
@@ -1,3 +1,13 @@
 import {QueryClient} from '@tanstack/react-query'
 
-export const queryClient = new QueryClient()
+export const queryClient = new QueryClient({
+  defaultOptions: {
+    queries: {
+      // NOTE
+      // refetchOnWindowFocus breaks some UIs (like feeds)
+      // so we NEVER want to enable this
+      // -prf
+      refetchOnWindowFocus: false,
+    },
+  },
+})