浏览代码

fix(api): upsert block property should work with editing mode

charlie 4 年之前
父节点
当前提交
0f39c9631e
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/main/frontend/handler/editor.cljs

+ 5 - 3
src/main/frontend/handler/editor.cljs

@@ -853,9 +853,11 @@
                                           :block/properties properties
                                           :block/content content})]
           (outliner-core/save-node block)
-          (let [opts {:key :block/change
-                      :data [block]}]
-            (db/refresh! repo opts)))))))
+
+          ;; update editing input content
+          (when-let [editing-block (state/get-edit-block)]
+            (and (= (:block/uuid editing-block) block-id)
+                 (state/set-edit-content! (state/get-edit-input-id) content))))))))
 
 (defn remove-block-property!
   [block-id key]