🐛 (webhook) Add loading bubble when executing webhook on client
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/js",
|
"name": "@typebot.io/js",
|
||||||
"version": "0.0.56",
|
"version": "0.0.57",
|
||||||
"description": "Javascript library to display typebots on your website",
|
"description": "Javascript library to display typebots on your website",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -69,7 +69,11 @@ export const ConversationContainer = (props: Props) => {
|
|||||||
(action) => isNotDefined(action.lastBubbleBlockId)
|
(action) => isNotDefined(action.lastBubbleBlockId)
|
||||||
)
|
)
|
||||||
for (const action of actionsBeforeFirstBubble) {
|
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, {
|
const response = await executeClientSideAction(action, {
|
||||||
apiHost: props.context.apiHost,
|
apiHost: props.context.apiHost,
|
||||||
sessionId: props.initialChatReply.sessionId,
|
sessionId: props.initialChatReply.sessionId,
|
||||||
@ -137,7 +141,11 @@ export const ConversationContainer = (props: Props) => {
|
|||||||
isNotDefined(action.lastBubbleBlockId)
|
isNotDefined(action.lastBubbleBlockId)
|
||||||
)
|
)
|
||||||
for (const action of actionsBeforeFirstBubble) {
|
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, {
|
const response = await executeClientSideAction(action, {
|
||||||
apiHost: props.context.apiHost,
|
apiHost: props.context.apiHost,
|
||||||
sessionId: props.initialChatReply.sessionId,
|
sessionId: props.initialChatReply.sessionId,
|
||||||
@ -182,7 +190,11 @@ export const ConversationContainer = (props: Props) => {
|
|||||||
(action) => action.lastBubbleBlockId === blockId
|
(action) => action.lastBubbleBlockId === blockId
|
||||||
)
|
)
|
||||||
for (const action of actionsToExecute) {
|
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, {
|
const response = await executeClientSideAction(action, {
|
||||||
apiHost: props.context.apiHost,
|
apiHost: props.context.apiHost,
|
||||||
sessionId: props.initialChatReply.sessionId,
|
sessionId: props.initialChatReply.sessionId,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@typebot.io/react",
|
"name": "@typebot.io/react",
|
||||||
"version": "0.0.56",
|
"version": "0.0.57",
|
||||||
"description": "React library to display typebots on your website",
|
"description": "React library to display typebots on your website",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
Reference in New Issue
Block a user