wip
This commit is contained in:
@@ -52,7 +52,11 @@ export default function NotificationProvider({ children }: NotificationProviderP
|
||||
|
||||
// Check for new notifications that need toast/modal display
|
||||
allNotifications.forEach((notification) => {
|
||||
if (notification.isUnread() && !seenNotificationIds.has(notification.id)) {
|
||||
// Check both unread and action_required status for modals
|
||||
const shouldDisplay = (notification.isUnread() || notification.isActionRequired()) &&
|
||||
!seenNotificationIds.has(notification.id);
|
||||
|
||||
if (shouldDisplay) {
|
||||
// Mark as seen to prevent duplicate displays
|
||||
setSeenNotificationIds((prev) => new Set([...prev, notification.id]));
|
||||
|
||||
@@ -79,6 +83,16 @@ export default function NotificationProvider({ children }: NotificationProviderP
|
||||
return () => clearInterval(interval);
|
||||
}, [currentDriverId, seenNotificationIds]);
|
||||
|
||||
// Prevent body scroll when modal is open
|
||||
useEffect(() => {
|
||||
if (modalNotification) {
|
||||
document.body.style.overflow = 'hidden';
|
||||
return () => {
|
||||
document.body.style.overflow = '';
|
||||
};
|
||||
}
|
||||
}, [modalNotification]);
|
||||
|
||||
const markAsRead = useCallback(async (notification: Notification) => {
|
||||
try {
|
||||
const markRead = getMarkNotificationReadUseCase();
|
||||
|
||||
Reference in New Issue
Block a user