From 419a0c936235c5955f9c385ae2390e696b962e49 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 28 May 2024 06:01:28 +0200 Subject: [PATCH] Prevent adding duplicate stash triggers to alert. --- components/alerts/create.vue | 64 +++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/components/alerts/create.vue b/components/alerts/create.vue index c032d4b..e4b6a46 100644 --- a/components/alerts/create.vue +++ b/components/alerts/create.vue @@ -329,37 +329,39 @@ /> -
  • - -
  • - -
  • - + @@ -497,8 +499,10 @@ function addMatch() { matchExpression.value = ''; } -function selectStash(stash) { - stashes.value.push(stash); +function selectStash(selectedStash) { + if (!stashes.value.some((stash) => stash.id === selectedStash.id)) { + stashes.value.push(selectedStash); + } }