From b0c82236aa79d82c4569fe369862e4672b525450 Mon Sep 17 00:00:00 2001 From: marcio1002 Date: Mon, 29 Jan 2024 15:47:18 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20ao=20carregar=20quantidade?= =?UTF-8?q?=20de=20notifica=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sidebar/Sidebar.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index 1f8aaa1..ceac926 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -58,7 +58,12 @@ export default function Sidebar() { }, [router.pathname]) useEffect(() => { - api.post('/notify').then(({ data: { data: notifyCount } }) => setNotificationsCount(notifyCount)) + api.post('/notify') + .then(({ data: { data: notifyCount } }) => setNotificationsCount(notifyCount)) + .catch(err => { + console.log(err) + setNotificationsCount(0) + }) }, []) return (