This commit is contained in:
2025-12-09 23:00:51 +01:00
parent 3659d25e52
commit 8fd8999e9e
4 changed files with 33 additions and 5 deletions

View File

@@ -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({

View File

@@ -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();