From e1348725c1cf1346eabb25c8477d3f8f9ee0668f Mon Sep 17 00:00:00 2001 From: Eva Date: Wed, 9 Feb 2022 16:08:55 +0100 Subject: [PATCH] :bug: fix error when posting an empty comment --- CHANGES.md | 1 + frontend/src/app/main/ui/comments.cljs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fad43cc30..ec0a807a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ ### :bug: Bugs fixed +- Fixed error when trying to post an empty comment [Taiga #2603](https://tree.taiga.io/project/penpot/issue/2603) - Fixed missing translation strings [Taiga #2786](https://tree.taiga.io/project/penpot/issue/2786) - Fixed color palette outside viewport [Taiga #2715](https://tree.taiga.io/project/penpot/issue/2715) - Fixed missing translate string [Taiga #2780](https://tree.taiga.io/project/penpot/issue/2780) diff --git a/frontend/src/app/main/ui/comments.cljs b/frontend/src/app/main/ui/comments.cljs index 7677ba445..ad5619c95 100644 --- a/frontend/src/app/main/ui/comments.cljs +++ b/frontend/src/app/main/ui/comments.cljs @@ -18,6 +18,7 @@ [app.util.keyboard :as kbd] [app.util.object :as obj] [app.util.time :as dt] + [cuerdas.core :as str] [okulary.core :as l] [rumext.alpha :as mf])) @@ -104,7 +105,7 @@ (when (or @show-buttons? (seq @content)) [:div.buttons - [:input.btn-primary {:type "button" :value "Post" :on-click on-submit}] + [:input.btn-primary {:type "button" :value "Post" :on-click on-submit :disabled (str/empty-or-nil? @content)}] [:input.btn-secondary {:type "button" :value "Cancel" :on-click on-cancel}]])])) (mf/defc draft-thread @@ -154,7 +155,8 @@ [:input.btn-primary {:on-click on-submit :type "button" - :value "Post"}] + :value "Post" + :disabled (str/empty-or-nil? content)}] [:input.btn-secondary {:on-click on-esc :type "button"