feat: verificar ticket id antes de atualizar lista de msgs

websocket
willian-pessoa 2024-05-09 16:01:21 -03:00
parent dac57f9d48
commit eb1d0f2303
1 changed files with 2 additions and 2 deletions

View File

@ -452,14 +452,14 @@ const MessagesList = ({ ticketId, isGroup }) => {
onAppMessageMessagesList = (data) => {
if (data.action === "create") {
if (data.action === "create" && data.ticket.id === ticketId) {
dispatch({ type: "ADD_MESSAGE", payload: data.message })
scrollToBottom()
}
if (data.action === "update") {
if (data.action === "update" && data.ticket.id === ticketId) {
dispatch({ type: "UPDATE_MESSAGE", payload: data.message })
}
}