Skip to content

Commit

Permalink
useIsConversatinVisible useMemo boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Oct 22, 2024
1 parent c75488f commit 085dd5b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>(
() => context.visibleConversations.some(c => c.uuid === conversationId),
[conversationId, context.visibleConversations]
)
}

0 comments on commit 085dd5b

Please sign in to comment.