fix(bot-engine): 🩹 Avatar scroll on media bubbles
This commit is contained in:
@@ -74,6 +74,7 @@ export const ChatBlock = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const displayNextStep = (answerContent?: string, isRetry?: boolean) => {
|
const displayNextStep = (answerContent?: string, isRetry?: boolean) => {
|
||||||
|
onScroll()
|
||||||
const currentStep = [...displayedSteps].pop()
|
const currentStep = [...displayedSteps].pop()
|
||||||
if (currentStep) {
|
if (currentStep) {
|
||||||
if (isRetry && stepCanBeRetried(currentStep))
|
if (isRetry && stepCanBeRetried(currentStep))
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export const ImageBubble = ({ step, onTransitionEnd }: Props) => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
sendAvatarOffset()
|
||||||
showContentAfterMediaLoad()
|
showContentAfterMediaLoad()
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
@@ -55,7 +56,9 @@ export const ImageBubble = ({ step, onTransitionEnd }: Props) => {
|
|||||||
const sendAvatarOffset = () => {
|
const sendAvatarOffset = () => {
|
||||||
if (!messageContainer.current) return
|
if (!messageContainer.current) return
|
||||||
const containerDimensions = messageContainer.current.getBoundingClientRect()
|
const containerDimensions = messageContainer.current.getBoundingClientRect()
|
||||||
updateLastAvatarOffset(containerDimensions.top + containerDimensions.height)
|
updateLastAvatarOffset(
|
||||||
|
messageContainer.current.offsetTop + containerDimensions.height
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export const VideoBubble = ({ step, onTransitionEnd }: Props) => {
|
|||||||
const [isTyping, setIsTyping] = useState(true)
|
const [isTyping, setIsTyping] = useState(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
sendAvatarOffset()
|
||||||
showContentAfterMediaLoad()
|
showContentAfterMediaLoad()
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
@@ -48,7 +49,9 @@ export const VideoBubble = ({ step, onTransitionEnd }: Props) => {
|
|||||||
const sendAvatarOffset = () => {
|
const sendAvatarOffset = () => {
|
||||||
if (!messageContainer.current) return
|
if (!messageContainer.current) return
|
||||||
const containerDimensions = messageContainer.current.getBoundingClientRect()
|
const containerDimensions = messageContainer.current.getBoundingClientRect()
|
||||||
updateLastAvatarOffset(containerDimensions.top + containerDimensions.height)
|
updateLastAvatarOffset(
|
||||||
|
messageContainer.current.offsetTop + containerDimensions.height
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user