From 085dd5b800f870128ab8673d8b3d496d67a30a30 Mon Sep 17 00:00:00 2001 From: Pete Miller Date: Mon, 21 Oct 2024 18:47:13 -0700 Subject: [PATCH] useIsConversatinVisible useMemo boolean --- .../ai_chat/resources/page/hooks/useIsConversationVisible.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/ai_chat/resources/page/hooks/useIsConversationVisible.ts b/components/ai_chat/resources/page/hooks/useIsConversationVisible.ts index 08003eb936d4..9cfd46fbaa2c 100644 --- a/components/ai_chat/resources/page/hooks/useIsConversationVisible.ts +++ b/components/ai_chat/resources/page/hooks/useIsConversationVisible.ts @@ -9,5 +9,8 @@ import { useAIChat } from "../state/ai_chat_context"; export default function useIsConversationVisible(conversationId?: string) { const context = useAIChat() - return !!useMemo(() => context.visibleConversations.find(c => c.uuid === conversationId), [conversationId, context.visibleConversations]) + return useMemo( + () => context.visibleConversations.some(c => c.uuid === conversationId), + [conversationId, context.visibleConversations] + ) }