Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulclindo committed Jan 18, 2025
1 parent 62e50b3 commit 773826c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions apps/shinkai-desktop/src/components/chat/conversation-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function ConversationChatFooter({
const selectedTool = chatForm.watch('tool');
const currentMessage = chatForm.watch('message');
const currentFiles = chatForm.watch('files');
const currentAI = chatForm.watch('agent');

const { data: chatConfig } = useGetChatConfig(
{
Expand Down Expand Up @@ -316,14 +317,13 @@ function ConversationChatFooter({
useHotkeys(
['mod+[', 'mod+]', 'ctrl+[', 'ctrl+]'],
(event) => {
if (inboxId) return; // switch for only empty chat for now
if (!llmProviders || !agents) return;

const allAIs = [
...(agents ?? []).map((a) => a.name),
...(llmProviders ?? []).map((l) => l.id),
];

const currentAI = chatForm.getValues('agent');
const currentIndex = allAIs.indexOf(currentAI ?? '');
if (currentIndex === -1) return;

Expand All @@ -338,10 +338,7 @@ function ConversationChatFooter({
},
{
enableOnFormTags: true,
enabled:
!!llmProviders?.length &&
!!agents?.length &&
!!chatForm.getValues('agent'),
enabled: !!llmProviders?.length && !!agents?.length && !!currentAI,
},
);

Expand Down Expand Up @@ -536,7 +533,7 @@ function ConversationChatFooter({
onValueChange={(value) => {
chatForm.setValue('agent', value);
}}
value={chatForm.watch('agent') ?? ''}
value={currentAI ?? ''}
/>
)}
<FileSelectionActionBar
Expand Down

0 comments on commit 773826c

Please sign in to comment.