From 0f3086bf34a37cace3812cd27982cc4f34ae5049 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Sat, 28 Mar 2026 02:21:28 +0530 Subject: [PATCH] fix --- src/app/(agent)/agent/notifications/page.tsx | 2 ++ src/app/(user)/user/notifications/page.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/app/(agent)/agent/notifications/page.tsx b/src/app/(agent)/agent/notifications/page.tsx index 2dcff69..65bf5cb 100644 --- a/src/app/(agent)/agent/notifications/page.tsx +++ b/src/app/(agent)/agent/notifications/page.tsx @@ -78,6 +78,7 @@ export default function AgentNotificationsPage() { } setUnreadCount((prev) => Math.max(0, prev - 1)); setTotalCount((prev) => prev); // total doesn't change, notification still exists + window.dispatchEvent(new Event('notification-received')); } catch (err) { console.error('Failed to mark as read:', err); } @@ -92,6 +93,7 @@ export default function AgentNotificationsPage() { setNotifications((prev) => prev.map((n) => ({ ...n, read: true }))); } setUnreadCount(0); + window.dispatchEvent(new Event('notification-received')); } catch (err) { console.error('Failed to mark all as read:', err); } diff --git a/src/app/(user)/user/notifications/page.tsx b/src/app/(user)/user/notifications/page.tsx index 2321d6f..ed92f7d 100644 --- a/src/app/(user)/user/notifications/page.tsx +++ b/src/app/(user)/user/notifications/page.tsx @@ -72,6 +72,7 @@ export default function UserNotificationsPage() { ); } setUnreadCount((prev) => Math.max(0, prev - 1)); + window.dispatchEvent(new Event('notification-received')); } catch (err) { console.error('Failed to mark as read:', err); } @@ -86,6 +87,7 @@ export default function UserNotificationsPage() { setNotifications((prev) => prev.map((n) => ({ ...n, read: true }))); } setUnreadCount(0); + window.dispatchEvent(new Event('notification-received')); } catch (err) { console.error('Failed to mark all as read:', err); }