2
0

fix(engine): 🐛 Quit flow if redirecting

This commit is contained in:
Baptiste Arnaud
2022-05-24 10:12:57 -07:00
parent 71c9c743d4
commit 91ea637a08

View File

@@ -16,7 +16,13 @@ import { executeIntegration } from 'services/integration'
import { parseRetryStep, stepCanBeRetried } from 'services/inputs' import { parseRetryStep, stepCanBeRetried } from 'services/inputs'
import { parseVariables } from '../../services/variable' import { parseVariables } from '../../services/variable'
import { useAnswers } from 'contexts/AnswersContext' import { useAnswers } from 'contexts/AnswersContext'
import { BubbleStep, InputStep, PublicTypebot, Step } from 'models' import {
BubbleStep,
InputStep,
LogicStepType,
PublicTypebot,
Step,
} from 'models'
import { HostBubble } from './ChatStep/bubbles/HostBubble' import { HostBubble } from './ChatStep/bubbles/HostBubble'
import { InputChatStep } from './ChatStep/InputChatStep' import { InputChatStep } from './ChatStep/InputChatStep'
import { getLastChatStepType } from '../../services/chat' import { getLastChatStepType } from '../../services/chat'
@@ -119,6 +125,10 @@ export const ChatBlock = ({
pushEdgeIdInLinkedTypebotQueue, pushEdgeIdInLinkedTypebotQueue,
currentTypebotId, currentTypebotId,
}) })
const isRedirecting =
currentStep.type === LogicStepType.REDIRECT &&
currentStep.options.isNewTab === false
if (isRedirecting) return
nextEdgeId ? onBlockEnd(nextEdgeId, linkedTypebot) : displayNextStep() nextEdgeId ? onBlockEnd(nextEdgeId, linkedTypebot) : displayNextStep()
} }
if (isIntegrationStep(currentStep)) { if (isIntegrationStep(currentStep)) {