mirror of https://github.com/logseq/logseq
fix: pages not displaying their page properties
on initial load. Page properties would only show up after clicking on Configure which is confusing and made the initial page load seem buggypull/11177/head
parent
0372cb6e62
commit
27aca24199
|
@ -17,7 +17,10 @@
|
|||
[clojure.string :as string]
|
||||
[logseq.db.frontend.property :as db-property]))
|
||||
|
||||
(rum/defc page-properties < rum/reactive
|
||||
(rum/defc page-properties
|
||||
"This component is called by page-inner and within configure/info modal. This should not
|
||||
be displaying properties from both components at the same time"
|
||||
< rum/reactive
|
||||
[page {:keys [mode configure?]}]
|
||||
(let [class? (= mode :class)
|
||||
edit-input-id-prefix (str "edit-block-" (:block/uuid page))
|
||||
|
@ -32,23 +35,23 @@
|
|||
(or has-viewable-properties?
|
||||
has-class-properties?)))
|
||||
[:div.ls-page-properties
|
||||
{:class (util/classnames [{:no-mode (nil? mode)
|
||||
:no-properties (if class?
|
||||
{:class (util/classnames [{:no-properties (if class?
|
||||
(not has-class-properties?)
|
||||
(not has-viewable-properties?))}])}
|
||||
(cond
|
||||
(= mode :class)
|
||||
(if (and config/publishing? (not configure?))
|
||||
(component-block/db-properties-cp {:editor-box editor/box}
|
||||
page
|
||||
(str edit-input-id-prefix "-page")
|
||||
(assoc configure-opts :class-schema? false))
|
||||
(if configure?
|
||||
(cond
|
||||
(= mode :class)
|
||||
(component-block/db-properties-cp {:editor-box editor/box}
|
||||
page
|
||||
(str edit-input-id-prefix "-schema")
|
||||
(assoc configure-opts :class-schema? true)))
|
||||
(assoc configure-opts :class-schema? true))
|
||||
|
||||
(= mode :page)
|
||||
(= mode :page)
|
||||
(component-block/db-properties-cp {:editor-box editor/box}
|
||||
page
|
||||
(str edit-input-id-prefix "-page")
|
||||
(assoc configure-opts :class-schema? false :page? true)))
|
||||
;; default view for page-inner
|
||||
(component-block/db-properties-cp {:editor-box editor/box}
|
||||
page
|
||||
(str edit-input-id-prefix "-page")
|
||||
|
|
|
@ -549,7 +549,7 @@
|
|||
[:div.mb-4
|
||||
(component-block/breadcrumb config repo block-id {:level-limit 3})]))
|
||||
|
||||
(when (and db-based? (not block?) (not preview?))
|
||||
(when (and db-based? (not block?) (not preview?) (not (::show-page-info? state)))
|
||||
(db-page/page-properties-react page {:configure? false}))
|
||||
|
||||
;; blocks
|
||||
|
|
Loading…
Reference in New Issue