diff --git a/src/components/panel/ConversationList.tsx b/src/components/panel/ConversationList.tsx index a03fb2e..2429689 100644 --- a/src/components/panel/ConversationList.tsx +++ b/src/components/panel/ConversationList.tsx @@ -1,7 +1,8 @@ +import React from "react"; import { User } from "lucide-react"; import { Card } from "@/components/ui/card"; -import { useQuery } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { createClient } from "@supabase/supabase-js"; import { formatDistanceToNow } from "date-fns"; @@ -23,6 +24,8 @@ interface Message { } export function ConversationList() { + const queryClient = useQueryClient(); + const { data: messages, isLoading } = useQuery({ queryKey: ['messages'], queryFn: async () => { @@ -58,7 +61,7 @@ export function ConversationList() { return () => { subscription.unsubscribe(); }; - }, []); + }, [queryClient]); if (isLoading) { return (