From fdd3bf04cb38a8b4f6355fa0e6c9c1a72d4badf4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 25 Oct 2025 20:28:16 -0700 Subject: [PATCH] remove unused code --- web_src/js/components/LabelSelector.vue | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/web_src/js/components/LabelSelector.vue b/web_src/js/components/LabelSelector.vue index 33f60b1a30..6f118bad17 100644 --- a/web_src/js/components/LabelSelector.vue +++ b/web_src/js/components/LabelSelector.vue @@ -118,33 +118,12 @@ const getLabelItem = (label: Label): string => { const toggleLabel = (labelId: string) => { if (props.readonly) return; - const clickedLabel = props.labels.find((l) => String(l.id) === labelId); - if (!clickedLabel) return; - const currentValues = [...props.modelValue]; const index = currentValues.indexOf(labelId); if (index > -1) { - // Remove the label if already selected currentValues.splice(index, 1); } else { - // Handle exclusive labels: remove other labels in same scope - const exclusiveScope = getExclusiveScope(clickedLabel); - if (exclusiveScope) { - // Remove all labels with the same exclusive scope - const labelsToRemove = props.labels - .filter((l) => { - const scope = getExclusiveScope(l); - return scope === exclusiveScope && String(l.id) !== labelId; - }) - .map((l) => String(l.id)); - - labelsToRemove.forEach((id) => { - const idx = currentValues.indexOf(id); - if (idx > -1) currentValues.splice(idx, 1); - }); - } - if (props.multiple) { currentValues.push(labelId); } else {