From dafe2ced3c87d6db7cf2457127763b9fe2f606f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20Ant=C3=B4nio=20Farias=20Machado?= Date: Mon, 26 Jun 2023 02:34:26 -0300 Subject: [PATCH] fix(frontend): errors and few warnings --- frontend/src/layouts/dashboard/top-nav.js | 18 ++++++++++++++---- frontend/src/pages/chat.js | 20 +++++++++++++++----- frontend/src/pages/devices.js | 2 +- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/frontend/src/layouts/dashboard/top-nav.js b/frontend/src/layouts/dashboard/top-nav.js index 2e873ee..c906b9d 100644 --- a/frontend/src/layouts/dashboard/top-nav.js +++ b/frontend/src/layouts/dashboard/top-nav.js @@ -134,7 +134,11 @@ export const TopNav = (props) => { aria-describedby="scroll-dialog-description" > - + { {call.from} - + - {}}> + {}}> {
- {}}> + {}}> { if(users.length == 0){ console.log("users is empty") return ( -
- +
+
) }else { @@ -77,7 +81,9 @@ const Page = () => { if (x.email !== window.sessionStorage.getItem("email")){ return ( - + {
{status === "online" ? - { + { router.push({ pathname:"chat/room", query: {user: x.email} @@ -104,7 +112,9 @@ const Page = () => { : - + diff --git a/frontend/src/pages/devices.js b/frontend/src/pages/devices.js index 43eefa3..f39129d 100644 --- a/frontend/src/pages/devices.js +++ b/frontend/src/pages/devices.js @@ -31,7 +31,7 @@ const Page = () => { .then(response => response.json()) .then(json => setDevices(json)) .catch(error => console.error('Error:', error)); - }, []); + }, [auth.user]); return (devices && <>