From cde4caeb4db0c455200ef6b3f31b7dccd59292bc Mon Sep 17 00:00:00 2001 From: tjtanjin Date: Fri, 24 May 2024 21:54:28 +0800 Subject: [PATCH] refactor: Clean up code to support notifications on embedded chatbot --- src/components/ChatBotContainer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ChatBotContainer.tsx b/src/components/ChatBotContainer.tsx index 8495eadd..a0630ab1 100644 --- a/src/components/ChatBotContainer.tsx +++ b/src/components/ChatBotContainer.tsx @@ -346,7 +346,8 @@ const ChatBotContainer = ({ flow }: { flow: Flow }) => { const message = messages[messages.length - 1] // if message is null or sent by user or is bot typing or bot is embedded, return - if (!message || message.sender === "user" || isBotTyping || botOptions.theme?.embedded) { + if (!message || message.sender === "user" || isBotTyping || (botOptions.theme?.embedded + && !isChatBotVisible(chatBodyRef.current as HTMLDivElement))) { return; }