From a28bbfc8df57c08764d2251b084a57d05bb18c95 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 9 Mar 2025 11:38:45 +0100 Subject: [PATCH] fix(labels): only show each label once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes™, directly after adding a label, it would show up multiple times. Sometimes, it was reproducible, other times it was not. This now fixes this by only showing labels unique by its id. --- frontend/src/components/tasks/partials/EditLabels.vue | 2 +- frontend/src/components/tasks/partials/Labels.vue | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/tasks/partials/EditLabels.vue b/frontend/src/components/tasks/partials/EditLabels.vue index 606131d6e..7b139b588 100644 --- a/frontend/src/components/tasks/partials/EditLabels.vue +++ b/frontend/src/components/tasks/partials/EditLabels.vue @@ -87,7 +87,7 @@ const query = ref('') watch( () => props.modelValue, (value) => { - labels.value = value + labels.value = Array.from(new Map(value.map(label => [label.id, label])).values()) }, { immediate: true, diff --git a/frontend/src/components/tasks/partials/Labels.vue b/frontend/src/components/tasks/partials/Labels.vue index 514b55967..31b6f3de8 100644 --- a/frontend/src/components/tasks/partials/Labels.vue +++ b/frontend/src/components/tasks/partials/Labels.vue @@ -1,7 +1,7 @@