Skip to content

Commit

Permalink
Fix delete blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Oct 9, 2020
1 parent 90d35ef commit 759be50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,9 @@
(let [{:keys [id block-id block-parent-id dummy? value pos format]} (get-state state)]
(when block-id
(when-let [page-id (:db/id (:block/page (db/entity [:block/uuid block-id])))]
(let [page-blocks-count (db/get-page-blocks-count repo page-id)]
(when (> page-blocks-count 2)
(let [page-blocks-count (db/get-page-blocks-count repo page-id)
page (db/entity page-id)]
(when (> page-blocks-count 1)
(util/stop e)
;; delete block, edit previous block
(let [block (db/pull [:block/uuid block-id])
Expand Down

0 comments on commit 759be50

Please sign in to comment.