diff --git a/src/chatbox.tsx b/src/chatbox.tsx index d0cbae1..790d1dd 100644 --- a/src/chatbox.tsx +++ b/src/chatbox.tsx @@ -56,11 +56,14 @@ export default function ChatBOX(props: { const [showAddToolMsg, setShowAddToolMsg] = useState(false); const [newToolCallID, setNewToolCallID] = useState(""); const [newToolContent, setNewToolContent] = useState(""); + const [follow, setFollow] = useState(true); const mediaRef = createRef(); const messagesEndRef = createRef(); useEffect(() => { - messagesEndRef.current.scrollIntoView({ behavior: "smooth" }); + if (follow) { + messagesEndRef.current.scrollIntoView({ behavior: "smooth" }); + } }, [showRetry, showGenerating, generatingMessage]); const client = new ChatGPT(chatStore.apiKey); @@ -804,6 +807,18 @@ export default function ChatBOX(props: { )} + {generatingMessage && ( + { + setFollow(!follow); + }} + > + + + + )}
{(chatStore.model.match("vision") || (chatStore.image_gen_api && chatStore.image_gen_key)) && (