浏览代码

fix: preserve blocks tree hierarchy for page embeds

Tienson Qin 4 年之前
父节点
当前提交
175988244a
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/main/frontend/components/block.cljs

+ 3 - 1
src/main/frontend/components/block.cljs

@@ -463,7 +463,8 @@
   (let [blocks (db/get-block-and-children (state/get-current-repo) id)]
     [:div.color-level.embed-block.bg-base-2 {:style {:z-index 2}}
      [:div.px-3.pt-1.pb-2
-      (blocks-container blocks (assoc (assoc config :id (str id))
+      (blocks-container blocks (assoc config
+                                      :id (str id)
                                       :embed? true
                                       :ref? false))]]))
 
@@ -483,6 +484,7 @@
                   page-name))
        (let [blocks (db/get-page-blocks (state/get-current-repo) page-name)]
          (blocks-container blocks (assoc config
+                                         :id page-name
                                          :embed? true
                                          :ref? false))))]))