diff --git a/apps/builder/components/shared/Graph/Nodes/StepNode/StepNodeContent/contents/TextBubbleContent.tsx b/apps/builder/components/shared/Graph/Nodes/StepNode/StepNodeContent/contents/TextBubbleContent.tsx index 09e67f6129..aa149b3e09 100644 --- a/apps/builder/components/shared/Graph/Nodes/StepNode/StepNodeContent/contents/TextBubbleContent.tsx +++ b/apps/builder/components/shared/Graph/Nodes/StepNode/StepNodeContent/contents/TextBubbleContent.tsx @@ -13,7 +13,7 @@ export const TextBubbleContent = ({ step }: Props) => { if (!typebot) return <> return ( { const { typebot } = useTypebot() const { user } = useUser() + const [localTypebotId, setLocalTypebotId] = useState(typebot?.id) + const [localUserId, setLocalUserId] = useState(user?.id) useEffect(() => { - if (isCloudProdInstance()) + if ( + isCloudProdInstance() && + (localTypebotId !== typebot?.id || localUserId !== user?.id) + ) { + setLocalTypebotId(typebot?.id) + setLocalUserId(user?.id) initBubble({ url: `${ process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? @@ -32,6 +39,7 @@ export const SupportBubble = () => { Plan: planToReadable(user?.plan), }, }) + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [user, typebot])