add maxScroll to chatmessage

This commit is contained in:
Henry
2023-04-20 19:09:47 +01:00
parent c8ef3c0966
commit 3428f6a893
4 changed files with 6 additions and 1 deletions
@@ -34,6 +34,8 @@ import useApi from 'hooks/useApi'
import useConfirm from 'hooks/useConfirm'
import useNotifier from 'utils/useNotifier'
import { maxScroll } from 'store/constant'
export const ChatMessage = ({ chatflowid }) => {
const theme = useTheme()
const customization = useSelector((state) => state.customization)
@@ -116,7 +118,7 @@ export const ChatMessage = ({ chatflowid }) => {
const scrollToBottom = () => {
if (ps.current) {
ps.current.scrollTo({ top: Number.MAX_SAFE_INTEGER, behavior: 'smooth' })
ps.current.scrollTo({ top: maxScroll, behavior: 'smooth' })
}
}