Some thin changes

pull/20/head
Renato Di Giacomo 2022-08-10 09:14:05 -03:00
parent f4f4a5941c
commit 658191d90f
2 changed files with 19 additions and 16 deletions

View File

@ -137,10 +137,10 @@ 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 ? user.sumOpen.count : "0"} {user.sumOpen ? user.sumOpen.count : 0}
</Typography> </Typography>
<Typography className={classes.tableCounterClosed}> <Typography className={classes.tableCounterClosed}>
{user.sumClosed ? user.sumClosed.count : "0"} {user.sumClosed ? user.sumClosed.count : 0}
</Typography> </Typography>
</div> </div>
</TableCell> </TableCell>

View File

@ -105,7 +105,6 @@ const useStyles = makeStyles((theme) => ({
})); }));
const reducer = (state, action) => { const reducer = (state, action) => {
if (action.type === "DELETE_USER_STATUS") { if (action.type === "DELETE_USER_STATUS") {
const userId = action.payload; const userId = action.payload;
@ -256,18 +255,17 @@ const Dashboard = () => {
useEffect(() => { useEffect(() => {
const socket = openSocket(process.env.REACT_APP_BACKEND_URL); const socket = openSocket(process.env.REACT_APP_BACKEND_URL);
socket.on("ticketStatus", (data) => { socket.on("ticketStatus", (data) => {
if (data.action === "update") { if (data.action === "update") {
console.log(ticketStatusChange);
// setStatus({...ticketStatusChange}, data.ticketStatus.status ) setStatus("");
console.log(ticketStatusChange);
setStatus(data.ticketStatus.status);
} }
}); });
socket.on("onlineStatus", (data) => { socket.on("onlineStatus", (data) => {
if (data.action === "logout" || data.action === "update") { if (data.action === "logout" || data.action === "update") {
// console.log('>>>>>>> data.userOnlineTime: ', data.userOnlineTime)
dispatch({ type: "UPDATE_STATUS_ONLINE", payload: data.userOnlineTime }); dispatch({ type: "UPDATE_STATUS_ONLINE", payload: data.userOnlineTime });
} else if (data.action === "delete") { } else if (data.action === "delete") {
dispatch({ type: "DELETE_USER_STATUS", payload: data.userOnlineTime }); dispatch({ type: "DELETE_USER_STATUS", payload: data.userOnlineTime });
@ -286,8 +284,7 @@ const Dashboard = () => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (ticketStatusChange === "") return console.log("foi");
const delayDebounceFn = setTimeout(() => { const delayDebounceFn = setTimeout(() => {
const fetchQueries = async () => { const fetchQueries = async () => {
try { try {
@ -310,7 +307,7 @@ const Dashboard = () => {
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }
}; };
fetchQueries(); fetchQueries();
}, 500); }, 500);
@ -334,7 +331,10 @@ const Dashboard = () => {
> >
tickets tickets
<Tooltip <Tooltip
title={`Os dados informados abaixo é baseado na data: ${new Date().toLocaleDateString()}`} title={`Os dados informados abaixo é baseado na data: ${new Date().toLocaleDateString(
"pt-BR",
{ timeZone: "UTC" }
)}`}
color="primary" color="primary"
TransitionComponent={Zoom} TransitionComponent={Zoom}
> >
@ -410,7 +410,10 @@ const Dashboard = () => {
> >
Usuários Usuários
<Tooltip <Tooltip
title={`Os dados informados abaixo é baseado na data: ${new Date().toLocaleDateString()}`} title={`Os dados informados abaixo é baseado na data: ${new Date().toLocaleDateString(
"pt-BR",
{ timeZone: "UTC" }
)}`}
color="primary" color="primary"
TransitionComponent={Zoom} TransitionComponent={Zoom}
> >
@ -494,4 +497,4 @@ const Dashboard = () => {
); );
}; };
export default Dashboard; export default Dashboard;