Skip to content

Commit

Permalink
refactor: Clean up code to support notifications on embedded chatbot
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed May 24, 2024
1 parent 55da3bf commit cde4cae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/ChatBotContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cde4cae

Please sign in to comment.