From 5754c393b9aa77391b4f34a816731526b7f85ad2 Mon Sep 17 00:00:00 2001 From: Luis de Dios Date: Tue, 25 Feb 2025 18:09:22 +0100 Subject: [PATCH] :bug: Fix avoid enabling post button if blank comment --- frontend/src/app/main/ui/comments.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index ee8882673..1b6d99244 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -132,10 +132,11 @@ (defn- blank-content? [content] - (or (str/blank? content) - (str/empty? content) - ;; If only one char and it's the zero-width whitespace - (and (= 1 (count content)) (= (first content) zero-width-space)))) + (let [content (str/trim content)] + (or (str/blank? content) + (str/empty? content) + (and (= (count content) 1) + (= (first content) zero-width-space))))) ;; Component that renders the component content (mf/defc comment-content*