diff --git a/frontend/src/lib/components/AnnotationLayer.svelte b/frontend/src/lib/components/AnnotationLayer.svelte index 5f8e57f8..316e649a 100644 --- a/frontend/src/lib/components/AnnotationLayer.svelte +++ b/frontend/src/lib/components/AnnotationLayer.svelte @@ -136,6 +136,14 @@ const containerStyle = $derived( aria-label="Annotation löschen" onclick={(e) => { e.stopPropagation(); + const count = commentCounts?.[annotation.id] ?? 0; + if (count > 0) { + const msg = + count === 1 + ? 'Diese Annotation hat 1 Kommentar. Beim Löschen wird er ebenfalls entfernt. Fortfahren?' + : `Diese Annotation hat ${count} Kommentare. Beim Löschen werden sie ebenfalls entfernt. Fortfahren?`; + if (!window.confirm(msg)) return; + } onDelete(annotation.id); }} style="