This commit is contained in:
pradeepkumar
2026-03-28 02:21:28 +05:30
parent bd40eaeb0c
commit 0f3086bf34
2 changed files with 4 additions and 0 deletions

View File

@@ -78,6 +78,7 @@ export default function AgentNotificationsPage() {
} }
setUnreadCount((prev) => Math.max(0, prev - 1)); setUnreadCount((prev) => Math.max(0, prev - 1));
setTotalCount((prev) => prev); // total doesn't change, notification still exists setTotalCount((prev) => prev); // total doesn't change, notification still exists
window.dispatchEvent(new Event('notification-received'));
} catch (err) { } catch (err) {
console.error('Failed to mark as read:', 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 }))); setNotifications((prev) => prev.map((n) => ({ ...n, read: true })));
} }
setUnreadCount(0); setUnreadCount(0);
window.dispatchEvent(new Event('notification-received'));
} catch (err) { } catch (err) {
console.error('Failed to mark all as read:', err); console.error('Failed to mark all as read:', err);
} }

View File

@@ -72,6 +72,7 @@ export default function UserNotificationsPage() {
); );
} }
setUnreadCount((prev) => Math.max(0, prev - 1)); setUnreadCount((prev) => Math.max(0, prev - 1));
window.dispatchEvent(new Event('notification-received'));
} catch (err) { } catch (err) {
console.error('Failed to mark as read:', 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 }))); setNotifications((prev) => prev.map((n) => ({ ...n, read: true })));
} }
setUnreadCount(0); setUnreadCount(0);
window.dispatchEvent(new Event('notification-received'));
} catch (err) { } catch (err) {
console.error('Failed to mark all as read:', err); console.error('Failed to mark all as read:', err);
} }