Skip to content

Commit

Permalink
fix: don't show the embed page if it's equal to the current page
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Nov 24, 2020
1 parent db652ab commit 0d6856d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/frontend/components/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,16 @@
[config page-name]
(let [page-name (string/lower-case page-name)
page-original-name (:page/original-name (db/entity [:page/name page-name]))
blocks (db/get-page-blocks (state/get-current-repo) page-name)]
blocks (db/get-page-blocks (state/get-current-repo) page-name)
current-page (state/get-current-page)]
[:div.embed-page.py-2.my-2.px-3.bg-base-2
[:p
[:code.mr-2 "Embed page:"]
(page-cp config {:page/name page-name})]
(blocks-container blocks (assoc config
:embed? true
:ref? false))]))
(when (not= (string/lower-case current-page) page-name)
(blocks-container blocks (assoc config
:embed? true
:ref? false)))]))

(defn- get-label-text
[label]
Expand Down

0 comments on commit 0d6856d

Please sign in to comment.