MCPcopy
hub / github.com/21st-dev/1code / usePrefetchRemoteChat

Function usePrefetchRemoteChat

src/renderer/lib/hooks/use-remote-chats.ts:91–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 * Prefetch a remote chat on hover (for instant loading when clicked)
90 */
91export function usePrefetchRemoteChat() {
92 const queryClient = useQueryClient()
93
94 return useCallback(
95 (chatId: string) => {
96 queryClient.prefetchQuery({
97 queryKey: ["remote-chat", chatId],
98 queryFn: () => remoteApi.getAgentChat(chatId),
99 staleTime: 60 * 1000,
100 })
101 },
102 [queryClient]
103 )
104}
105
106/**
107 * Fetch archived remote chats for the selected team

Callers 1

AgentsSidebarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected