2
0

feat(engine): ️ Attempt to make redirections more reliable

This commit is contained in:
Baptiste Arnaud
2022-04-19 14:45:08 -07:00
parent 54a757b21b
commit a089a451b6

View File

@ -127,10 +127,10 @@ const executeRedirect = (
{ typebot: { variables } }: LogicContext
): EdgeId | undefined => {
if (!step.options?.url) return step.outgoingEdgeId
window.open(
sanitizeUrl(parseVariables(variables)(step.options?.url)),
step.options.isNewTab ? '_blank' : '_self'
)
const tempLink = document.createElement('a')
tempLink.href = sanitizeUrl(parseVariables(variables)(step.options?.url))
tempLink.setAttribute('target', step.options.isNewTab ? '_blank' : '_self')
tempLink.click()
return step.outgoingEdgeId
}