From bfb8ab407b24cf9caa8fcf505a53c1e396d924e5 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 22 Sep 2022 19:18:16 +0200 Subject: [PATCH] feat(task wizard): add label removal --- src/views/tasks/CreateTask.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/views/tasks/CreateTask.vue b/src/views/tasks/CreateTask.vue index ca5157a3..798855c1 100644 --- a/src/views/tasks/CreateTask.vue +++ b/src/views/tasks/CreateTask.vue @@ -45,6 +45,7 @@ :style="{'background': label.hexColor, 'color': label.textColor}" class="tag mr-2"> {{ label.title }} + @@ -122,6 +123,16 @@ const realLabels = computed(() => { ] }) +function removeLabel(label: ILabel) { + while (true) { // Using a loop to remove all labels, including possible duplicates added via quick add magic + const index = labels.value.findIndex(el => el.toLowerCase() === label.title.toLowerCase()) + if (index === -1) { + break + } + labels.value.splice(index, 1) + } +} + async function create() { if (newTask.value.title === '') { errorMessage.value = t('list.create.addTitleRequired')