fix: 🐛 Support bubble closes on save
This commit is contained in:
@ -13,7 +13,7 @@ export const TextBubbleContent = ({ step }: Props) => {
|
|||||||
if (!typebot) return <></>
|
if (!typebot) return <></>
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
isTruncated
|
w="90%"
|
||||||
flexDir={'column'}
|
flexDir={'column'}
|
||||||
opacity={step.content.html === '' ? '0.5' : '1'}
|
opacity={step.content.html === '' ? '0.5' : '1'}
|
||||||
className="slate-html-container"
|
className="slate-html-container"
|
||||||
|
@ -1,16 +1,23 @@
|
|||||||
import { useTypebot } from 'contexts/TypebotContext'
|
import { useTypebot } from 'contexts/TypebotContext'
|
||||||
import { useUser } from 'contexts/UserContext'
|
import { useUser } from 'contexts/UserContext'
|
||||||
import { Plan } from 'db'
|
import { Plan } from 'db'
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { isCloudProdInstance } from 'services/utils'
|
import { isCloudProdInstance } from 'services/utils'
|
||||||
import { initBubble } from 'typebot-js'
|
import { initBubble } from 'typebot-js'
|
||||||
|
|
||||||
export const SupportBubble = () => {
|
export const SupportBubble = () => {
|
||||||
const { typebot } = useTypebot()
|
const { typebot } = useTypebot()
|
||||||
const { user } = useUser()
|
const { user } = useUser()
|
||||||
|
const [localTypebotId, setLocalTypebotId] = useState(typebot?.id)
|
||||||
|
const [localUserId, setLocalUserId] = useState(user?.id)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isCloudProdInstance())
|
if (
|
||||||
|
isCloudProdInstance() &&
|
||||||
|
(localTypebotId !== typebot?.id || localUserId !== user?.id)
|
||||||
|
) {
|
||||||
|
setLocalTypebotId(typebot?.id)
|
||||||
|
setLocalUserId(user?.id)
|
||||||
initBubble({
|
initBubble({
|
||||||
url: `${
|
url: `${
|
||||||
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
|
||||||
@ -32,6 +39,7 @@ export const SupportBubble = () => {
|
|||||||
Plan: planToReadable(user?.plan),
|
Plan: planToReadable(user?.plan),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [user, typebot])
|
}, [user, typebot])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user