From 4d7423ed3aa2bb163d0249430f817346e7fc3da5 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 11 Dec 2024 22:15:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20Check=20if=20state=20ha?= =?UTF-8?q?s=20currentBlockId=20defined=20before=20autocontinuing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bot-engine/src/apiHandlers/continueChat.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/bot-engine/src/apiHandlers/continueChat.ts b/packages/bot-engine/src/apiHandlers/continueChat.ts index 4952c4f7a..f5f2de590 100644 --- a/packages/bot-engine/src/apiHandlers/continueChat.ts +++ b/packages/bot-engine/src/apiHandlers/continueChat.ts @@ -69,12 +69,14 @@ export const continueChat = async ({ lastMessageNewFormat, visitedEdges, setVariableHistory, - } = await autoContinueChatIfStartingWithInput({ - message, - chatReply, - textBubbleContentFormat, - version: 2, - }); + } = !session.state.currentBlockId + ? await autoContinueChatIfStartingWithInput({ + message, + chatReply, + textBubbleContentFormat, + version: 2, + }) + : chatReply; if (newSessionState) await saveStateToDatabase({