diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsx index 9e0ad7f382..87ceccdc71 100644 --- a/client/src/components/Chat/Input/ChatForm.tsx +++ b/client/src/components/Chat/Input/ChatForm.tsx @@ -83,10 +83,8 @@ const ChatForm = memo(function ChatForm({ const [badges, setBadges] = useRecoilState(store.chatBadges); const [isEditingBadges, setIsEditingBadges] = useRecoilState(store.isEditingBadges); const [showStopButton, setShowStopButton] = useRecoilState(store.showStopButtonByIndex(index)); - const [showPlusPopover, setShowPlusPopover] = useRecoilState(store.showPlusPopoverFamily(index)); - const [showMentionPopover, setShowMentionPopover] = useRecoilState( - store.showMentionPopoverFamily(index), - ); + const plusPopoverAtom = useMemo(() => store.showPlusPopoverFamily(index), [index]); + const mentionPopoverAtom = useMemo(() => store.showMentionPopoverFamily(index), [index]); const { requiresKey } = useRequiresKey(); const methods = useChatFormContext(); @@ -158,8 +156,6 @@ const ChatForm = memo(function ChatForm({ const handleKeyUp = useHandleKeyUp({ index, textAreaRef, - setShowPlusPopover, - setShowMentionPopover, }); const { isNotAppendable, @@ -242,23 +238,21 @@ const ChatForm = memo(function ChatForm({ >