Skip to content

Commit

Permalink
fix spychat window changing when new ticket arrives
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Nov 9, 2024
1 parent 93f7489 commit c95952f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/TicketMessagesDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ export default function TicketMessagesDialog({ open, handleClose, ticketId }) {
}

const onCompanyTicketMessagesDialog = (data) => {
if (data.action === "update") {
if (data.action === "update" && data.ticket.id === ticket.id) {
setTicket(data.ticket);
}

if (data.action === "delete") {
toast.success("Ticket deleted sucessfully.");
if (data.action === "delete" && data.ticketId === ticket.id) {
history.push("/tickets");
}
}
Expand Down

0 comments on commit c95952f

Please sign in to comment.