From 0f8341aaa4e23b86c037720cb0b4d3423545c13e Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Thu, 6 Mar 2025 11:03:58 +1000 Subject: [PATCH] ts --- apps/studio/hooks/useAssistant.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/apps/studio/hooks/useAssistant.ts b/apps/studio/hooks/useAssistant.ts index 43fc7b3e449..a32fb14a87f 100644 --- a/apps/studio/hooks/useAssistant.ts +++ b/apps/studio/hooks/useAssistant.ts @@ -218,14 +218,7 @@ export function useAssistant(options?: UseAssistantOptions) { } } }, - [ - chats, - activeChatId, - currentChatBelongsToProject, - projectRef, - projectChatsRecord, - setAiAssistantPanel, - ] + [activeChatId, projectChatsRecord] ) const openAssistant = useCallback( @@ -258,7 +251,7 @@ export function useAssistant(options?: UseAssistantOptions) { handleNewChat() } }, - [projectRef, setAiAssistantPanel, handleNewChat] + [projectRef] ) const closeAssistant = useCallback(() => { @@ -287,9 +280,7 @@ export function useAssistant(options?: UseAssistantOptions) { activeChat: currentChatBelongsToProject && activeChatId ? projectChatsRecord[activeChatId] : undefined, isOpen: open, - messages: (currentChatBelongsToProject && activeChatId - ? projectChatsRecord[activeChatId]?.messages || [] - : chats?.[activeChatId || 'default']?.messages || []) as Message[], + messages: projectChatsRecord[activeChatId || 'default']?.messages as Message[], // Actions newChat: handleNewChat,