Chat thread not rendering when changing chat thread id #2675
-
I'm trying to build a chat from the ChatComposite from the UI ACS library. I'm currently generating a list of chat threads where the user can click the list item and change the thread id for the ChatComposite with a useState function and props for the composite. At first render, the ChatComposite works as expected, where you as the user can click a list item and the ChatComposite renders the chat with its thread. But then, if you click another list item to render the ChatComposite with a new thread id, the ChatComposite updates its topic but it does not load the chat thread. It even lets you send messages and the stores the new message in the correct thread. Here is the list item where I grab the thread id and set the value as prop for the Chat Component where the ChatComposite resides:
} export default Chat; Here is the ChatComponent where I construct the chatAdapters from the props: ` const ChatComponent = (props) => {
} ` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solve by adding
where one renders the ChatComposite |
Beta Was this translation helpful? Give feedback.
Solve by adding
chatAdapter.loadPreviousChatMessages(20);
where one renders the ChatComposite