🐛 fix error when posting an empty comment

This commit is contained in:
Eva 2022-02-09 16:08:55 +01:00 committed by Andrés Moya
parent 528839cde2
commit e1348725c1
2 changed files with 5 additions and 2 deletions

View file

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