Correção do count no Tableuser e atualizaçã para exibir a quantidade de tickets aberto/fechado em tempo real

pull/20/head
adriano 2022-08-10 12:55:56 -03:00
parent 3bfcf56ad8
commit ec19fb6799
2 changed files with 6 additions and 8 deletions

View File

@ -137,7 +137,7 @@ const TableUser = ({ classes, usersOnlineInfo, logout }) => {
<TableCell> <TableCell>
<div style={{ display: "flex", alignItems: "center", gap: "12px" }}> <div style={{ display: "flex", alignItems: "center", gap: "12px" }}>
<Typography className={classes.tableCounterOpen}> <Typography className={classes.tableCounterOpen}>
{user.sumOpen === undefined ? 0 : user.sumOpen} {user.sumOpen === undefined ? 0 : user.sumOpen.count}
</Typography> </Typography>
<Typography className={classes.tableCounterClosed}> <Typography className={classes.tableCounterClosed}>
{user.sumClosed === undefined ? 0 : user.sumClosed.count} {user.sumClosed === undefined ? 0 : user.sumClosed.count}

View File

@ -257,9 +257,7 @@ const Dashboard = () => {
socket.on("ticketStatus", (data) => { socket.on("ticketStatus", (data) => {
if (data.action === "update") { if (data.action === "update") {
console.log(ticketStatusChange);
setStatus(""); setStatus("");
console.log(ticketStatusChange);
setStatus(data.ticketStatus.status); setStatus(data.ticketStatus.status);
} }
}); });
@ -281,7 +279,7 @@ const Dashboard = () => {
return () => { return () => {
socket.disconnect(); socket.disconnect();
}; };
}, [ticketStatusChange]); }, []);
useEffect(() => { useEffect(() => {
if (ticketStatusChange === "") return console.log("foi"); if (ticketStatusChange === "") return console.log("foi");