Correção ao carregar quantidade de notificações

This commit is contained in:
marcio1002 2024-01-29 15:47:18 -03:00
parent c19f3651c5
commit b0c82236aa

View File

@ -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 (