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
+1
View File
@@ -0,0 +1 @@
PORT=3000
+1
View File
@@ -0,0 +1 @@
PORT=8080
+1
View File
@@ -2,4 +2,5 @@
export const gridSpacing = 3
export const drawerWidth = 260
export const appDrawerWidth = 320
export const maxScroll = 100000
export const baseURL = process.env.NODE_ENV === 'production' ? window.location.origin : window.location.origin.replace(':8080', ':3000')
@@ -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' })
}
}