2
0

feat(editor): ️ Add 'Current' to Link typebot

This commit is contained in:
Baptiste Arnaud
2022-03-25 14:59:40 +01:00
parent d06cbeac73
commit fb60dcf5ff
8 changed files with 29 additions and 12 deletions

View File

@@ -139,8 +139,10 @@ const executeTypebotLink = async (
}> => {
const { typebot, linkedTypebots, onNewLog, createEdge } = context
const linkedTypebot =
[typebot, ...linkedTypebots].find(byId(step.options.typebotId)) ??
(await fetchAndInjectTypebot(step, context))
step.options.typebotId === 'current'
? typebot
: [typebot, ...linkedTypebots].find(byId(step.options.typebotId)) ??
(await fetchAndInjectTypebot(step, context))
if (!linkedTypebot) {
onNewLog({
status: 'error',

View File

@@ -94,7 +94,7 @@ export type CodeOptions = {
}
export type TypebotLinkOptions = {
typebotId?: string
typebotId?: string | 'current'
blockId?: string
}