Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

fix: throttle scroll to bottom

Daniel Avila4cd0ff26827c
diff --git a/client/src/components/Messages/TextWrapper.jsx b/client/src/components/Messages/TextWrapper.jsx
index ff6f9a1528..3cfd0a1b37 100644
--- a/client/src/components/Messages/TextWrapper.jsx
+++ b/client/src/components/Messages/TextWrapper.jsx
@@ -49,7 +49,6 @@ const inLineWrap = (parts) => {
export default function TextWrapper({ text, generateCursor }) {
let embedTest = false;
let result = null;
- console.log('text wrapper', text)
// to match unenclosed code blocks
if (text.match(/```/g)?.length === 1) {
diff --git a/client/src/components/Messages/index.jsx b/client/src/components/Messages/index.jsx
index 0d1754780a..f734e58cdf 100644
--- a/client/src/components/Messages/index.jsx
+++ b/client/src/components/Messages/index.jsx
@@ -1,5 +1,6 @@
import React, { useEffect, useState, useRef, useCallback } from 'react';
import Spinner from '../svg/Spinner';
+import { throttle } from 'lodash';
import { CSSTransition } from 'react-transition-group';
import ScrollToBottom from './ScrollToBottom';
import MultiMessage from './MultiMessage';
@@ -34,10 +35,11 @@ export default function Messages({ messages, messageTree }) {
};
}, [messages]);
- const scrollToBottom = useCallback(() => {
+ const scrollToBottom = useCallback(throttle(() => {
+ console.log('scrollToBottom');
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
setShowScrollButton(false);
- }, [messagesEndRef]);
+ }, 750), [messagesEndRef]);
const handleScroll = () => {
const { scrollTop, scrollHeight, clientHeight } = scrollableRef.current;