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); }