Merge pull request #5960 from penpot/luis-fix-avoid-post-blank-comment

🐛 Fix avoid enabling post button if blank comment
This commit is contained in:
luisδμ 2025-02-26 09:28:59 +01:00 committed by GitHub
commit 5fcf889d3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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*