fix: duplicated blocks when editing

This commit is contained in:
Tienson Qin
2021-02-20 12:58:48 +08:00
parent 9bf8bef59a
commit 901f0321cd
2 changed files with 150 additions and 141 deletions

View File

@@ -423,10 +423,7 @@
(:start-pos meta)
(:end-pos meta))}
;; Preserve the original block id
(when (and (zero? idx)
;; not custom-id
(not (get-in block [:block/properties "custom_id"]))
(not (get-in block [:block/properties "id"])))
(when (zero? idx)
{:block/uuid uuid})
(when (seq ref-pages)
{:block/ref-pages