Skip to content

Commit fdd3bf0

Browse files
committed
remove unused code
1 parent 4a2734a commit fdd3bf0

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

web_src/js/components/LabelSelector.vue

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,33 +118,12 @@ const getLabelItem = (label: Label): string => {
118118
const toggleLabel = (labelId: string) => {
119119
if (props.readonly) return;
120120
121-
const clickedLabel = props.labels.find((l) => String(l.id) === labelId);
122-
if (!clickedLabel) return;
123-
124121
const currentValues = [...props.modelValue];
125122
const index = currentValues.indexOf(labelId);
126123
127124
if (index > -1) {
128-
// Remove the label if already selected
129125
currentValues.splice(index, 1);
130126
} else {
131-
// Handle exclusive labels: remove other labels in same scope
132-
const exclusiveScope = getExclusiveScope(clickedLabel);
133-
if (exclusiveScope) {
134-
// Remove all labels with the same exclusive scope
135-
const labelsToRemove = props.labels
136-
.filter((l) => {
137-
const scope = getExclusiveScope(l);
138-
return scope === exclusiveScope && String(l.id) !== labelId;
139-
})
140-
.map((l) => String(l.id));
141-
142-
labelsToRemove.forEach((id) => {
143-
const idx = currentValues.indexOf(id);
144-
if (idx > -1) currentValues.splice(idx, 1);
145-
});
146-
}
147-
148127
if (props.multiple) {
149128
currentValues.push(labelId);
150129
} else {

0 commit comments

Comments
 (0)