about summary refs log tree commit diff
path: root/src/state/queries/profile.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-01-10 22:27:14 -0800
committerGitHub <noreply@github.com>2024-01-10 22:27:14 -0800
commit7ab4be6f7d5a89f752ebd989d9c730a9e135a989 (patch)
treeb6d45ac19bf83af827268fb3c282d6db3643dcc1 /src/state/queries/profile.ts
parent0442dcc1a01a613985155c86a5ee042085553f33 (diff)
downloadvoidsky-7ab4be6f7d5a89f752ebd989d9c730a9e135a989.tar.zst
Reduce polling (#2465)
* Move profile and preference polling to polls-on-foreground

* Refetch prefs on feeds screen refresh since polling no longer occurs

* Reduce notifications polling by 50% if there's already an unread

* Disable feed polling if we know we have content

* Disable the hard refresh after 1 hour in case it's the cause of the random feed refresh bug

* Fix types
Diffstat (limited to 'src/state/queries/profile.ts')
-rw-r--r--src/state/queries/profile.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts
index 40ba0653c..21e2e5775 100644
--- a/src/state/queries/profile.ts
+++ b/src/state/queries/profile.ts
@@ -35,7 +35,7 @@ export function useProfileQuery({did}: {did: string | undefined}) {
     // if you remove it, the UI infinite-loops
     // -prf
     staleTime: isCurrentAccount ? STALE.SECONDS.THIRTY : STALE.MINUTES.FIVE,
-    refetchInterval: STALE.MINUTES.FIVE,
+    refetchOnWindowFocus: true,
     queryKey: RQKEY(did || ''),
     queryFn: async () => {
       const res = await getAgent().getProfile({actor: did || ''})