From 334b6032479070c3eaad46aa1e718628b92a963a Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 6 Apr 2024 16:09:16 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20refactor:=20Attempt=20Default=20?= =?UTF-8?q?Preset=20Fix=20&=20Other=20Changes=20(#2342)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(useTextarea): trigger SendButton re-render on undo and clearing text * refactor(PresetItems): show pin icon for default preset * fix(ChatRoute): do not use conversation.model for useEffect, do not set default Preset if real model list is not yet fetched --- .../Chat/Menus/Presets/PresetItems.tsx | 9 +++++++-- client/src/hooks/Conversations/usePresets.ts | 19 +++++++++++++------ client/src/hooks/Input/useTextarea.ts | 2 ++ client/src/routes/ChatRoute.tsx | 8 +------- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/client/src/components/Chat/Menus/Presets/PresetItems.tsx b/client/src/components/Chat/Menus/Presets/PresetItems.tsx index 957a7b06bb..df4742aeab 100644 --- a/client/src/components/Chat/Menus/Presets/PresetItems.tsx +++ b/client/src/components/Chat/Menus/Presets/PresetItems.tsx @@ -1,4 +1,3 @@ -import { Trash2 } from 'lucide-react'; import { useRecoilValue } from 'recoil'; import { Close } from '@radix-ui/react-popover'; import { Flipper, Flipped } from 'react-flip-toolkit'; @@ -13,6 +12,7 @@ import { Dialog, DialogTrigger, Label } from '~/components/ui/'; import { MenuSeparator, MenuItem } from '../UI'; import { icons } from '../Endpoints/Icons'; import { useLocalize } from '~/hooks'; +import { cn } from '~/utils'; import store from '~/store'; const PresetItems: FC<{ @@ -143,7 +143,12 @@ const PresetItems: FC<{ >