@ -17,7 +17,7 @@ export const WebPreview = () => {
|
||||
logs?.forEach((log) => {
|
||||
showToast({
|
||||
icon: <WebhookIcon />,
|
||||
status: log.status === 'error' ? 'error' : 'success',
|
||||
status: log.status as 'success' | 'error' | 'info',
|
||||
title: log.status === 'error' ? 'An error occured' : undefined,
|
||||
description: log.description,
|
||||
details: log.details
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.0.46",
|
||||
"version": "0.0.47",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { ChatReply, Theme } from '@typebot.io/schemas'
|
||||
import { ChatReply, Theme } from '@typebot.io/schemas'
|
||||
import { InputBlockType } from '@typebot.io/schemas/features/blocks/inputs/enums'
|
||||
import { createEffect, createSignal, For, onMount, Show } from 'solid-js'
|
||||
import { sendMessageQuery } from '@/queries/sendMessageQuery'
|
||||
import { ChatChunk } from './ChatChunk'
|
||||
@ -89,9 +90,16 @@ export const ConversationContainer = (props: Props) => {
|
||||
|
||||
const sendMessage = async (message: string | undefined) => {
|
||||
setHasError(false)
|
||||
const currentBlockId = [...chatChunks()].pop()?.input?.id
|
||||
if (currentBlockId && props.onAnswer && message)
|
||||
props.onAnswer({ message, blockId: currentBlockId })
|
||||
const currentInputBlock = [...chatChunks()].pop()?.input
|
||||
if (currentInputBlock?.id && props.onAnswer && message)
|
||||
props.onAnswer({ message, blockId: currentInputBlock.id })
|
||||
if (currentInputBlock?.type === InputBlockType.FILE)
|
||||
props.onNewLogs?.([
|
||||
{
|
||||
description: 'Files are not uploaded in preview mode',
|
||||
status: 'info',
|
||||
},
|
||||
])
|
||||
const longRequest = setTimeout(() => {
|
||||
setIsSending(true)
|
||||
}, 1000)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.0.46",
|
||||
"version": "0.0.47",
|
||||
"description": "React library to display typebots on your website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
Reference in New Issue
Block a user