feat(engine): ⚡️ Attempt to make redirections more reliable
This commit is contained in:
@ -127,10 +127,10 @@ const executeRedirect = (
|
|||||||
{ typebot: { variables } }: LogicContext
|
{ typebot: { variables } }: LogicContext
|
||||||
): EdgeId | undefined => {
|
): EdgeId | undefined => {
|
||||||
if (!step.options?.url) return step.outgoingEdgeId
|
if (!step.options?.url) return step.outgoingEdgeId
|
||||||
window.open(
|
const tempLink = document.createElement('a')
|
||||||
sanitizeUrl(parseVariables(variables)(step.options?.url)),
|
tempLink.href = sanitizeUrl(parseVariables(variables)(step.options?.url))
|
||||||
step.options.isNewTab ? '_blank' : '_self'
|
tempLink.setAttribute('target', step.options.isNewTab ? '_blank' : '_self')
|
||||||
)
|
tempLink.click()
|
||||||
return step.outgoingEdgeId
|
return step.outgoingEdgeId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user