verbesserung von benachrichtungen und warnungen an nutzer abgeschlossen. layout editor nun auf gutem stand.
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
||||
import { AlertTriangle, ArrowLeft, Loader2, Save, Sparkles } from 'lucide-react';
|
||||
import toast from 'react-hot-toast';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
|
||||
@@ -203,6 +204,23 @@ export default function EventFormPage() {
|
||||
return buildLimitWarnings(loadedEvent?.limits, tLimits);
|
||||
}, [isEdit, loadedEvent?.limits, tLimits]);
|
||||
|
||||
const shownToastRef = React.useRef<Set<string>>(new Set());
|
||||
|
||||
React.useEffect(() => {
|
||||
limitWarnings.forEach((warning) => {
|
||||
const key = `${warning.id}-${warning.message}`;
|
||||
if (shownToastRef.current.has(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
shownToastRef.current.add(key);
|
||||
toast(warning.message, {
|
||||
icon: warning.tone === 'danger' ? '🚨' : '⚠️',
|
||||
id: key,
|
||||
});
|
||||
});
|
||||
}, [limitWarnings]);
|
||||
|
||||
const limitScopeLabels = React.useMemo(() => ({
|
||||
photos: tLimits('photosTitle'),
|
||||
guests: tLimits('guestsTitle'),
|
||||
|
||||
Reference in New Issue
Block a user