about summary refs log tree commit diff
path: root/src/state/queries/util.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-12-04 17:53:22 -0800
committerGitHub <noreply@github.com>2023-12-04 17:53:22 -0800
commitd07ea64434709f1ce43bde3d6e45ca4dc99b0733 (patch)
tree6bfaf69dbe213a110538acd7eb9d90c0f9841884 /src/state/queries/util.ts
parent160055e4f96762567c69c3f2629ec03ad64fb4d7 (diff)
downloadvoidsky-d07ea64434709f1ce43bde3d6e45ca4dc99b0733.tar.zst
Fix: correctly partial-match when calling truncateAndInvalidate() (#2088)
Diffstat (limited to 'src/state/queries/util.ts')
-rw-r--r--src/state/queries/util.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state/queries/util.ts b/src/state/queries/util.ts
index 0b3eefea2..ed91a8f2a 100644
--- a/src/state/queries/util.ts
+++ b/src/state/queries/util.ts
@@ -2,9 +2,9 @@ import {QueryClient, QueryKey, InfiniteData} from '@tanstack/react-query'
 
 export function truncateAndInvalidate<T = any>(
   queryClient: QueryClient,
-  querykey: QueryKey,
+  queryKey: QueryKey,
 ) {
-  queryClient.setQueryData<InfiniteData<T>>(querykey, data => {
+  queryClient.setQueriesData<InfiniteData<T>>({queryKey}, data => {
     if (data) {
       return {
         pageParams: data.pageParams.slice(0, 1),
@@ -13,5 +13,5 @@ export function truncateAndInvalidate<T = any>(
     }
     return data
   })
-  queryClient.invalidateQueries({queryKey: querykey})
+  queryClient.invalidateQueries({queryKey})
 }