Browse Source

fix: block add button not shown when the last child is embeded block

Tienson Qin 8 months ago
parent
commit
abb52d61a7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/main/frontend/components/page.cljs

+ 3 - 2
src/main/frontend/components/page.cljs

@@ -241,8 +241,9 @@
               blocks (if block? [block] (db/sort-by-order children block))]
           (let [add-button? (not (or config/publishing?
                                      (let [last-child-id (model/get-block-deep-last-open-child-id (db/get-db) (:db/id (last blocks)))
-                                           block' (if last-child-id (db/entity last-child-id) (last blocks))]
-                                       (string/blank? (:block/title block')))))]
+                                           block' (if last-child-id (db/entity last-child-id) (last blocks))
+                                           link (:block/link block')]
+                                       (string/blank? (:block/title (or link block'))))))]
             [:div
              {:class (when add-button? "show-add-button")}
              (page-blocks-inner page-e blocks config sidebar? whiteboard? block-id)