Merge pull request #397 from Hexastack/fix/sequence-messages-not-displaying
Some checks are pending
Build and Push Docker Images / paths-filter (push) Waiting to run
Build and Push Docker Images / build-and-push (push) Blocked by required conditions

Fix/sequence messages not displaying
This commit is contained in:
Med Marrouchi 2024-12-03 09:47:28 +01:00 committed by GitHub
commit 3e04e99f3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,7 +249,10 @@ const ChatProvider: React.FC<{
newIOMessage.delivery = true;
}
setMessages([...messages, newIOMessage as TMessage]);
setMessages((prevMessages) => [
...prevMessages,
newIOMessage as TMessage,
]);
setScroll(0);
}
@ -271,7 +274,8 @@ const ChatProvider: React.FC<{
} else {
setSuggestions([]);
}
isOpen || updateNewMessagesCount(newMessagesCount + 1);
isOpen ||
updateNewMessagesCount((prevMessagesCount) => prevMessagesCount + 1);
settings.alwaysScrollToBottom && setScroll(101); // @hack
setOutgoingMessageState(OutgoingMessageState.sent);
};