From 1d2992943876c127ed6345655f29496fcaafac93 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 27 Nov 2023 14:27:30 +0000 Subject: [PATCH] impr(custom text): not allowing empty custom text --- frontend/src/ts/popups/custom-text-popup.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/ts/popups/custom-text-popup.ts b/frontend/src/ts/popups/custom-text-popup.ts index 693910836..1ed6a2d9c 100644 --- a/frontend/src/ts/popups/custom-text-popup.ts +++ b/frontend/src/ts/popups/custom-text-popup.ts @@ -227,6 +227,11 @@ $(`${popup} .randomInputFields .sectioncount input`).on("keypress", () => { function apply(): void { let text = ($(`${popup} textarea`).val() as string).normalize(); + if (text === "") { + Notifications.add("Text cannot be empty", 0); + return; + } + text = text.trim(); // text = text.replace(/[\r]/gm, " ");