From 20dde445125da264bde94b6a99a60e79ccccefdb Mon Sep 17 00:00:00 2001 From: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:47:32 -0400 Subject: [PATCH] fix(Settings.jsx): fix Settings inputs losing focus to main textarea (#646) * fix(Settings.jsx): fix Settings inputs losing focus to main textarea * refactor(Input/index.jsx): remove console.log statement in useEffect --- client/src/components/Input/index.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/Input/index.jsx b/client/src/components/Input/index.jsx index a3510affdd..90a11e4eeb 100644 --- a/client/src/components/Input/index.jsx +++ b/client/src/components/Input/index.jsx @@ -33,23 +33,23 @@ export default function TextChat({ isSearchView = false }) { const [showBingToneSetting, setShowBingToneSetting] = useState(false); const isNotAppendable = latestMessage?.unfinished & !isSubmitting || latestMessage?.error; + const { conversationId, jailbreak } = conversation || {}; // auto focus to input, when enter a conversation. useEffect(() => { - const { conversationId } = conversation || {}; if (!conversationId) { return; } // Prevents Settings from not showing on new conversation, also prevents showing toneStyle change without jailbreak - if (conversationId === 'new' || !conversation?.jailbreak) { + if (conversationId === 'new' || !jailbreak) { setShowBingToneSetting(false); } if (conversationId !== 'search') { inputRef.current?.focus(); } - }, [conversation]); + }, [conversationId, jailbreak]); useEffect(() => { const timeoutId = setTimeout(() => { @@ -135,7 +135,7 @@ export default function TextChat({ isSearchView = false }) { return ( <> -