diff --git a/packages/react/src/components/ChatBody/ChatBody.js b/packages/react/src/components/ChatBody/ChatBody.js index a636ba671..5f147f425 100644 --- a/packages/react/src/components/ChatBody/ChatBody.js +++ b/packages/react/src/components/ChatBody/ChatBody.js @@ -13,6 +13,7 @@ import useAttachmentWindowStore from '../../store/attachmentwindow'; import ThreadMessageList from '../Thread/ThreadMessageList'; import ModalBlock from '../uiKit/blocks/ModalBlock'; import useComponentOverrides from '../../theme/useComponentOverrides'; +import { Home } from '../Home'; const ChatBody = ({ height, anonymousMode, showRoles, messageListRef }) => { const { classNames, styleOverrides } = useComponentOverrides('ChatBody'); @@ -85,6 +86,7 @@ const ChatBody = ({ height, anonymousMode, showRoles, messageListRef }) => { async (anonymousMode) => { try { if (!isUserAuthenticated && !anonymousMode) { + setMessages([]); return; } const { messages } = await RCInstance.getMessages( @@ -274,6 +276,8 @@ const ChatBody = ({ height, anonymousMode, showRoles, messageListRef }) => { className={`ec-chat-body ${classNames}`} height={height} > + {!isUserAuthenticated && !anonymousMode && } + {onDrag ? ( handleDragDrop(e)} className={DragComponentCss}> Drop to upload file @@ -287,8 +291,11 @@ const ChatBody = ({ height, anonymousMode, showRoles, messageListRef }) => { ) : ( )} + + + {isModalOpen && ( )} - {isUserAuthenticated || anonymousMode ? ( - - ) : ( - - )} +