Compare commits
No commits in common. "435a577bedabba86cda50b31d1230a17208d4fd1" and "3ced558b184dee55df92be88d35086536dce4386" have entirely different histories.
435a577bed
...
3ced558b18
|
@ -451,16 +451,15 @@ const MessagesList = ({ ticketId, isGroup }) => {
|
|||
socket.on("connect", onConnectMessagesList)
|
||||
|
||||
const onAppMessageMessagesList = (data) => {
|
||||
if (+data.message.ticketId !== +ticketId) return
|
||||
|
||||
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 })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,15 +143,11 @@ const Ticket = () => {
|
|||
socket.on("connect", onConnectTicket)
|
||||
|
||||
const onTicketTicket = (data) => {
|
||||
const isSameTicket = +data?.ticket?.id === +ticketId || +data.ticketId === +ticketId
|
||||
if (!isSameTicket) return
|
||||
|
||||
if (data.action === "update") {
|
||||
if (data.action === "update" && data.ticket.id == ticketId) {
|
||||
setTicket(data.ticket)
|
||||
}
|
||||
|
||||
if (data.action === "deleteForever") {
|
||||
console.log('delete forever')
|
||||
if (data.action === "delete") {
|
||||
toast.success("Ticket deleted sucessfully.")
|
||||
history.push("/tickets")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue