(paymentInput) Handle Stripe redirection

Closes #631
This commit is contained in:
Baptiste Arnaud
2023-07-27 17:25:02 +02:00
parent e499478dee
commit c99298e49b
15 changed files with 109 additions and 21 deletions

View File

@@ -13,6 +13,7 @@ import { PreviewMessage, PreviewMessageProps } from './PreviewMessage'
import { isDefined } from '@typebot.io/lib'
import { BubbleParams } from '../types'
import { Bot, BotProps } from '../../../components/Bot'
import { getPaymentInProgressInStorage } from '@/features/blocks/inputs/payment/helpers/paymentInProgressStorage'
export type BubbleProps = BotProps &
BubbleParams & {
@@ -51,6 +52,8 @@ export const Bubble = (props: BubbleProps) => {
const autoShowDelay = bubbleProps.autoShowDelay
const previewMessageAutoShowDelay =
bubbleProps.previewMessage?.autoShowDelay
const paymentInProgress = getPaymentInProgressInStorage()
if (paymentInProgress) openBot()
if (isDefined(autoShowDelay)) {
setTimeout(() => {
openBot()