⚡ Add dynamic timeout to bot engine api
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.2.25",
|
||||
"version": "0.2.26",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
@@ -170,13 +170,20 @@ export const ConversationContainer = (props: Props) => {
|
||||
setIsSending(false)
|
||||
if (error) {
|
||||
setHasError(true)
|
||||
props.onNewLogs?.([
|
||||
const errorLogs = [
|
||||
{
|
||||
description: 'Failed to send the reply',
|
||||
details: error,
|
||||
status: 'error',
|
||||
},
|
||||
])
|
||||
]
|
||||
await saveClientLogsQuery({
|
||||
apiHost: props.context.apiHost,
|
||||
sessionId: props.initialChatReply.sessionId,
|
||||
clientLogs: errorLogs,
|
||||
})
|
||||
props.onNewLogs?.(errorLogs)
|
||||
return
|
||||
}
|
||||
if (!data) return
|
||||
if (data.lastMessageNewFormat) {
|
||||
|
||||
@@ -103,6 +103,7 @@ export const InputChatBlock = (props: Props) => {
|
||||
block={props.block}
|
||||
inputIndex={props.inputIndex}
|
||||
isInputPrefillEnabled={props.isInputPrefillEnabled}
|
||||
existingAnswer={props.hasError ? answer() : undefined}
|
||||
onTransitionEnd={props.onTransitionEnd}
|
||||
onSubmit={handleSubmit}
|
||||
onSkip={handleSkip}
|
||||
@@ -118,6 +119,7 @@ const Input = (props: {
|
||||
block: NonNullable<ContinueChatResponse['input']>
|
||||
inputIndex: number
|
||||
isInputPrefillEnabled: boolean
|
||||
existingAnswer?: string
|
||||
onTransitionEnd: () => void
|
||||
onSubmit: (answer: InputSubmitContent) => void
|
||||
onSkip: (label: string) => void
|
||||
@@ -125,7 +127,8 @@ const Input = (props: {
|
||||
const onSubmit = (answer: InputSubmitContent) => props.onSubmit(answer)
|
||||
|
||||
const getPrefilledValue = () =>
|
||||
props.isInputPrefillEnabled ? props.block.prefilledValue : undefined
|
||||
props.existingAnswer ??
|
||||
(props.isInputPrefillEnabled ? props.block.prefilledValue : undefined)
|
||||
|
||||
const submitPaymentSuccess = () =>
|
||||
props.onSubmit({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/nextjs",
|
||||
"version": "0.2.25",
|
||||
"version": "0.2.26",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.2.25",
|
||||
"version": "0.2.26",
|
||||
"description": "Convenient library to display typebots on your React app",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user