()
| 55 | const isMobile = useIsMobile(); |
| 56 | |
| 57 | const fetchNotifications = async () => { |
| 58 | try { |
| 59 | setLoading(true); |
| 60 | const res = await fetch("/api/notifications"); |
| 61 | const data = await res.json(); |
| 62 | setNotifications(data.notifications || []); |
| 63 | setUnreadCount(data.unreadCount || 0); |
| 64 | } catch (error) { |
| 65 | console.error("Failed to fetch notifications:", error); |
| 66 | } finally { |
| 67 | setLoading(false); |
| 68 | } |
| 69 | }; |
| 70 | |
| 71 | useEffect(() => { |
| 72 | fetchNotifications(); |
no outgoing calls
no test coverage detected