fix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user