fix: search tab does not receives websockets updates

This commit is contained in:
canove
2020-09-26 19:34:52 -03:00
parent 881a47f33a
commit 574fe9c517
2 changed files with 6 additions and 1 deletions

View File

@@ -176,7 +176,11 @@ const TicketsList = ({ status, searchParam, showAll }) => {
useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
socket.emit("joinTickets", status);
if (status) {
socket.emit("joinTickets", status);
} else {
socket.emit("joinNotification");
}
socket.on("ticket", data => {
if (data.action === "updateUnread") {

View File

@@ -165,6 +165,7 @@ const TicketsManager = () => {
<IconButton
aria-label="add ticket"
size="small"
color="primary"
onClick={e => setNewTicketModalOpen(true)}
style={{ marginLeft: 20 }}
>