mirror of
https://github.com/logseq/logseq.git
synced 2026-05-30 07:29:48 +00:00
fix: keep comment editor open on save failure
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
[frontend.date :as date]
|
||||
[frontend.format.block :as block]
|
||||
[frontend.handler.comments :as comments-handler]
|
||||
[frontend.handler.notification :as notification]
|
||||
[frontend.handler.paste :as paste-handler]
|
||||
[frontend.handler.reaction :as reaction-handler]
|
||||
[frontend.handler.user :as user-handler]
|
||||
@@ -337,8 +338,11 @@
|
||||
:refocus-after-submit? false
|
||||
:on-cancel #(set-editing! false)
|
||||
:on-submit (fn [content]
|
||||
(comments-handler/save-comment! comment-block content)
|
||||
(set-editing! false))})
|
||||
(-> (comments-handler/save-comment! comment-block content)
|
||||
(p/then (fn [_]
|
||||
(set-editing! false)))
|
||||
(p/catch (fn [_error]
|
||||
(notification/show! (t :block.comments/save-error) :error)))))})
|
||||
[:div.ls-comment-body
|
||||
(block-content-or-editor
|
||||
config
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
:block.comments/label "Comments"
|
||||
:block.comments/on-those-blocks "On those blocks"
|
||||
:block.comments/placeholder "Reply..."
|
||||
:block.comments/save-error "Failed to save comment."
|
||||
:block.comments/yesterday-at "Yesterday at {1}"
|
||||
|
||||
:block.macro/embed-deprecated "{{embed}} is deprecated. Use '/Node embed' command instead."
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
:block.comments/label "评论"
|
||||
:block.comments/on-those-blocks "在这些块上"
|
||||
:block.comments/placeholder "回复..."
|
||||
:block.comments/save-error "保存评论失败。"
|
||||
:block.comments/yesterday-at "昨天 {1}"
|
||||
|
||||
:block.macro/embed-deprecated "{{embed}} 已弃用。请改用“/节点嵌入”命令。"
|
||||
|
||||
Reference in New Issue
Block a user