mirror of https://github.com/logseq/logseq
fix: lazy load contents
parent
21c1f4f54c
commit
0a5ca160f9
|
@ -202,11 +202,6 @@
|
|||
{:page page-name})]
|
||||
(add-button args)))])))))
|
||||
|
||||
(defn contents-page
|
||||
[page]
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(page-blocks-cp repo page {:sidebar? true})))
|
||||
|
||||
(rum/defc today-queries < rum/reactive
|
||||
[repo today? sidebar?]
|
||||
(when (and today? (not sidebar?))
|
||||
|
@ -576,6 +571,15 @@
|
|||
(or (:page-name option)
|
||||
(get-page-name state))))
|
||||
|
||||
(rum/defc contents-page < rum/reactive
|
||||
{:init (fn [state]
|
||||
(db-async/<get-block-and-children (state/get-current-repo) "contents")
|
||||
state)}
|
||||
[page]
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(when-not (state/sub-block-unloaded? "contents")
|
||||
(page-blocks-cp repo page {:sidebar? true}))))
|
||||
|
||||
(defonce layout (atom [js/window.innerWidth js/window.innerHeight]))
|
||||
|
||||
;; scrollHeight
|
||||
|
|
Loading…
Reference in New Issue