🐛 (typebotLink) Fix fetching when typebot ID is current bot ID
This commit is contained in:
@@ -23,8 +23,11 @@ export const executeTypebotLink = async (
|
|||||||
const linkedTypebot = (
|
const linkedTypebot = (
|
||||||
block.options.typebotId === 'current'
|
block.options.typebotId === 'current'
|
||||||
? typebot
|
? typebot
|
||||||
: [typebot, ...linkedTypebots].find(byId(block.options.typebotId)) ??
|
: [typebot, ...linkedTypebots].find((typebot) =>
|
||||||
(await fetchAndInjectTypebot(block, context))
|
'typebotId' in typebot
|
||||||
|
? typebot.typebotId === block.options.typebotId
|
||||||
|
: typebot.id === block.options.typebotId
|
||||||
|
) ?? (await fetchAndInjectTypebot(block, context))
|
||||||
) as PublicTypebot | LinkedTypebot | undefined
|
) as PublicTypebot | LinkedTypebot | undefined
|
||||||
if (!linkedTypebot) {
|
if (!linkedTypebot) {
|
||||||
onNewLog({
|
onNewLog({
|
||||||
|
|||||||
Reference in New Issue
Block a user