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

@ -94,7 +94,7 @@ const TableUser = ({ classes, usersOnlineInfo, logout }) => {
</TableHead>
<TableBody>
{usersOnlineInfo &&
{usersOnlineInfo &&
usersOnlineInfo
.filter((e) => {
if (filterStatus === null) return e;
@ -135,9 +135,9 @@ 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}>
{user.sumOpen === undefined ? 0 : user.sumOpen}
{user.sumOpen === undefined ? 0 : user.sumOpen.count}
</Typography>
<Typography className={classes.tableCounterClosed}>
{user.sumClosed === undefined ? 0 : user.sumClosed.count}

View File

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