2
0

🐛 (webhook) Add loading bubble when executing webhook on client

This commit is contained in:
Baptiste Arnaud
2023-05-26 12:00:16 +02:00
parent 154271c7f2
commit 4dec06fc75
3 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.0.56",
"version": "0.0.57",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",

View File

@ -69,7 +69,11 @@ export const ConversationContainer = (props: Props) => {
(action) => isNotDefined(action.lastBubbleBlockId)
)
for (const action of actionsBeforeFirstBubble) {
if ('streamOpenAiChatCompletion' in action) setIsSending(true)
if (
'streamOpenAiChatCompletion' in action ||
'webhookToExecute' in action
)
setIsSending(true)
const response = await executeClientSideAction(action, {
apiHost: props.context.apiHost,
sessionId: props.initialChatReply.sessionId,
@ -137,7 +141,11 @@ export const ConversationContainer = (props: Props) => {
isNotDefined(action.lastBubbleBlockId)
)
for (const action of actionsBeforeFirstBubble) {
if ('streamOpenAiChatCompletion' in action) setIsSending(true)
if (
'streamOpenAiChatCompletion' in action ||
'webhookToExecute' in action
)
setIsSending(true)
const response = await executeClientSideAction(action, {
apiHost: props.context.apiHost,
sessionId: props.initialChatReply.sessionId,
@ -182,7 +190,11 @@ export const ConversationContainer = (props: Props) => {
(action) => action.lastBubbleBlockId === blockId
)
for (const action of actionsToExecute) {
if ('streamOpenAiChatCompletion' in action) setIsSending(true)
if (
'streamOpenAiChatCompletion' in action ||
'webhookToExecute' in action
)
setIsSending(true)
const response = await executeClientSideAction(action, {
apiHost: props.context.apiHost,
sessionId: props.initialChatReply.sessionId,

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.0.56",
"version": "0.0.57",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",