fix: update message ack

websocket
adriano 2024-05-22 09:51:10 -03:00
parent 3ced558b18
commit fce5554681
1 changed files with 3 additions and 2 deletions

View File

@ -451,15 +451,16 @@ const MessagesList = ({ ticketId, isGroup }) => {
socket.on("connect", onConnectMessagesList)
const onAppMessageMessagesList = (data) => {
if (+data.message.ticketId !== +ticketId) return
if (data.action === "create" && data.ticket.id == ticketId) {
if (data.action === "create") {
dispatch({ type: "ADD_MESSAGE", payload: data.message })
scrollToBottom()
}
if (data.action === "update" && data.ticket.id == ticketId) {
if (data.action === "update") {
dispatch({ type: "UPDATE_MESSAGE", payload: data.message })
}
}