wip
This commit is contained in:
@@ -61,7 +61,18 @@ export function LeagueStewardingSection({
|
||||
onChange,
|
||||
readOnly = false,
|
||||
}: LeagueStewardingSectionProps) {
|
||||
const stewarding = form.stewarding;
|
||||
// Provide default stewarding settings if not present
|
||||
const stewarding = form.stewarding ?? {
|
||||
decisionMode: 'admin_only' as const,
|
||||
requiredVotes: 2,
|
||||
requireDefense: false,
|
||||
defenseTimeLimit: 48,
|
||||
voteTimeLimit: 72,
|
||||
protestDeadlineHours: 48,
|
||||
stewardingClosesHours: 168,
|
||||
notifyAccusedOnProtest: true,
|
||||
notifyOnVoteRequired: true,
|
||||
};
|
||||
|
||||
const updateStewarding = (updates: Partial<LeagueStewardingFormDTO>) => {
|
||||
onChange({
|
||||
|
||||
@@ -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