From 9a19f3a945a44278f0c9750abae9110abeebddfd Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 4 Mar 2022 10:57:16 +0100 Subject: [PATCH] If label is empty, reset the correction state (to allow template deletion) --- ui/src/components/CorrectionResponses.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/components/CorrectionResponses.svelte b/ui/src/components/CorrectionResponses.svelte index 4ddd669..5f0e694 100644 --- a/ui/src/components/CorrectionResponses.svelte +++ b/ui/src/components/CorrectionResponses.svelte @@ -40,9 +40,9 @@ const my_correction = { }; for (const tpl of templates) { - if (!tpl.regexp) continue; + if (!tpl.regexp && tpl.label) continue; - if (r.value.match(tpl.regexp)) { + if (tpl.regexp && r.value.match(tpl.regexp)) { my_correction[tpl.id] = true; } else { my_correction[tpl.id] = false;