2
0

fix(engine): 🐛 Webhook call on linked typebot

This commit is contained in:
Baptiste Arnaud
2022-03-31 10:33:35 +02:00
parent 7f5d2f4173
commit 86117d6d3c
3 changed files with 13 additions and 2 deletions

View File

@ -13,10 +13,12 @@ export type LinkedTypebot = Pick<
'id' | 'blocks' | 'variables' | 'edges'
>
const typebotContext = createContext<{
currentTypebotId: string
typebot: PublicTypebot
linkedTypebots: LinkedTypebot[]
apiHost: string
isPreview: boolean
setCurrentTypebotId: (id: string) => void
updateVariableValue: (variableId: string, value: string) => void
createEdge: (edge: Edge) => void
injectLinkedTypebot: (typebot: Typebot | PublicTypebot) => LinkedTypebot
@ -40,6 +42,7 @@ export const TypebotContext = ({
}) => {
const [localTypebot, setLocalTypebot] = useState<PublicTypebot>(typebot)
const [linkedTypebots, setLinkedTypebots] = useState<LinkedTypebot[]>([])
const [currentTypebotId, setCurrentTypebotId] = useState(typebot.id)
useEffect(() => {
setLocalTypebot((localTypebot) => ({
@ -95,6 +98,8 @@ export const TypebotContext = ({
createEdge,
injectLinkedTypebot,
onNewLog,
currentTypebotId,
setCurrentTypebotId,
}}
>
{children}