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>
<div style={{ display: "flex", alignItems: "center", gap: "12px" }}>
<Typography className={classes.tableCounterOpen}>
{user.sumOpen ? user.sumOpen.count : "0"}
{user.sumOpen ? user.sumOpen.count : 0}
</Typography>
<Typography className={classes.tableCounterClosed}>
{user.sumClosed ? user.sumClosed.count : "0"}
{user.sumClosed ? user.sumClosed.count : 0}
</Typography>
</div>
</TableCell>

View File

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