perf(hooks): normalize query keys and add placeholderData to optimize thread loading

This commit is contained in:
SohamBhattacharjee2003 2026-04-03 14:42:44 +05:30
parent 0fa4939a71
commit 8eaa4e618d
2 changed files with 3 additions and 2 deletions

View file

@ -109,6 +109,7 @@ export function AllPrivateChatsSidebarContent({
queryKey: ["all-threads", searchSpaceId],
queryFn: () => fetchThreads(Number(searchSpaceId)),
enabled: !!searchSpaceId && !isSearchMode,
placeholderData: () => queryClient.getQueryData(["threads", searchSpaceId, { limit: 40 }]),
});
const {