fix: block content not saved when exit code mode

This commit is contained in:
Tienson Qin
2024-10-03 18:30:40 +08:00
parent ccb6ee48e4
commit a53943e19e
6 changed files with 63 additions and 56 deletions

View File

@@ -390,11 +390,10 @@
[config]
(p/do!
(code-handler/save-code-editor!)
(when-let [block-id (:block/uuid config)]
(let [block (db/entity [:block/uuid block-id])]
(when-let [block (:block config)]
(let [block (db/entity [:block/uuid (:block/uuid block)])]
(state/set-state! :editor/raw-mode-block block)
(when-not (= (:db/id block) (:db/id (state/get-edit-block)))
(editor-handler/edit-block! block :max))))))
(editor-handler/edit-block! block :max {:save-code-editor? false})))))
(defn ^:large-vars/cleanup-todo render!
[state]