about summary refs log tree commit diff
path: root/src/state/queries/profile.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-02-07 11:18:51 +0000
committerGitHub <noreply@github.com>2025-02-07 11:18:51 +0000
commit4b706c9519c548d53529876bdf815836ec71bdd4 (patch)
tree96485dcb1de8c7344287bebb890cd5832f527dfa /src/state/queries/profile.ts
parentb12d39b4cff0fe1b91fb16496c3fea1ed22de5cf (diff)
downloadvoidsky-4b706c9519c548d53529876bdf815836ec71bdd4.tar.zst
Per-user search history (#7588)
* per-user search history

* move to mmkv with cool new hook

* revert accidental changes

This reverts commit 27c89fa645eff0acb7a8fd852203ff1ea3725c69.

* restore limits
Diffstat (limited to 'src/state/queries/profile.ts')
-rw-r--r--src/state/queries/profile.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts
index fa5675e87..291999ae1 100644
--- a/src/state/queries/profile.ts
+++ b/src/state/queries/profile.ts
@@ -10,6 +10,7 @@ import {
   ComAtprotoRepoUploadBlob,
 } from '@atproto/api'
 import {
+  keepPreviousData,
   QueryClient,
   useMutation,
   useQuery,
@@ -81,7 +82,13 @@ export function useProfileQuery({
   })
 }
 
-export function useProfilesQuery({handles}: {handles: string[]}) {
+export function useProfilesQuery({
+  handles,
+  maintainData,
+}: {
+  handles: string[]
+  maintainData?: boolean
+}) {
   const agent = useAgent()
   return useQuery({
     staleTime: STALE.MINUTES.FIVE,
@@ -90,6 +97,7 @@ export function useProfilesQuery({handles}: {handles: string[]}) {
       const res = await agent.getProfiles({actors: handles})
       return res.data
     },
+    placeholderData: maintainData ? keepPreviousData : undefined,
   })
 }