From b7b0812bfa8c3c38edfa82cdbfaa21075a035899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Aug 2022 20:40:43 +0100 Subject: [PATCH] CustomCategory: apply-close -> do not close after error --- src/customCategory.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/customCategory.js b/src/customCategory.js index 63d89c7a..2ca224da 100644 --- a/src/customCategory.js +++ b/src/customCategory.js @@ -129,8 +129,9 @@ class CustomCategoryEditor { inputClose.type = 'button' inputClose.value = lang('apply-close') inputClose.onclick = () => { - this.submit() - this.window.close() + if (this.submit()) { + this.window.close() + } } controls.appendChild(inputClose) @@ -164,10 +165,12 @@ class CustomCategoryEditor { submit () { const err = customCategoryTest(this.textarea.value) if (err) { - return global.alert(err) + global.alert(err) + return false } this.applyContent(this.textarea.value) + return true } applyContent (content) {