fix: 🐛 Typebot support bubble hidden vars
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
import { useTypebot } from 'contexts/TypebotContext'
|
import { useTypebot } from 'contexts/TypebotContext'
|
||||||
import { useUser } from 'contexts/UserContext'
|
import { useUser } from 'contexts/UserContext'
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
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 router = useRouter()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initBubble({
|
initBubble({
|
||||||
@@ -16,14 +14,14 @@ export const SupportBubble = () => {
|
|||||||
backgroundColor: '#ffffff',
|
backgroundColor: '#ffffff',
|
||||||
button: { color: '#0042DA' },
|
button: { color: '#0042DA' },
|
||||||
hiddenVariables: {
|
hiddenVariables: {
|
||||||
'Current URL': window.location.href,
|
|
||||||
'User ID': user?.id,
|
'User ID': user?.id,
|
||||||
|
Name: user?.name ?? undefined,
|
||||||
Email: user?.email ?? undefined,
|
Email: user?.email ?? undefined,
|
||||||
'Typebot ID': typebot?.id,
|
'Typebot ID': typebot?.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [router])
|
}, [user, typebot])
|
||||||
|
|
||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user