mirror of https://github.com/logseq/logseq
fix: loading whiteboard
parent
92cb360a2f
commit
6d7d4497ff
|
@ -122,8 +122,8 @@
|
||||||
(let [block (d/entity db (if (uuid? id)
|
(let [block (d/entity db (if (uuid? id)
|
||||||
[:block/uuid id]
|
[:block/uuid id]
|
||||||
id))
|
id))
|
||||||
get-children (fn [children]
|
get-children (fn [block children]
|
||||||
(let [long-page? (> (count children) 500)]
|
(let [long-page? (and (> (count children) 500) (not (contains? (:block/type block) "whiteboard")))]
|
||||||
(if long-page?
|
(if long-page?
|
||||||
(map (fn [e]
|
(map (fn [e]
|
||||||
(select-keys e [:db/id :block/uuid :block/page :block/left :block/parent :block/collapsed?]))
|
(select-keys e [:db/id :block/uuid :block/page :block/left :block/parent :block/collapsed?]))
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
{:block block'
|
{:block block'
|
||||||
:properties (property-with-values db block)}
|
:properties (property-with-values db block)}
|
||||||
children?
|
children?
|
||||||
(assoc :children (get-children (:block/_parent block)))))
|
(assoc :children (get-children block (:block/_parent block)))))
|
||||||
(cond->
|
(cond->
|
||||||
{:block (->> (d/pull db '[*] (:db/id block))
|
{:block (->> (d/pull db '[*] (:db/id block))
|
||||||
(with-tags db)
|
(with-tags db)
|
||||||
|
@ -156,11 +156,7 @@
|
||||||
:properties (property-with-values db block)}
|
:properties (property-with-values db block)}
|
||||||
children?
|
children?
|
||||||
(assoc :children
|
(assoc :children
|
||||||
(if (contains? (:block/type block) "whiteboard")
|
(get-children block (:block/_page block))))))))
|
||||||
(->> (d/pull-many db '[*] (map :db/id (:block/_page block)))
|
|
||||||
(map #(with-block-refs db %))
|
|
||||||
(map mark-block-fully-loaded))
|
|
||||||
(get-children (:block/_page block)))))))))
|
|
||||||
|
|
||||||
(defn get-latest-journals
|
(defn get-latest-journals
|
||||||
[db n]
|
[db n]
|
||||||
|
|
|
@ -220,7 +220,7 @@
|
||||||
(rum/defc tldraw-app-inner < rum/reactive
|
(rum/defc tldraw-app-inner < rum/reactive
|
||||||
{:init (fn [state]
|
{:init (fn [state]
|
||||||
(let [page-uuid (first (:rum/args state))]
|
(let [page-uuid (first (:rum/args state))]
|
||||||
(db-async/<get-block (state/get-current-repo) (str page-uuid))
|
(db-async/<get-block (state/get-current-repo) page-uuid)
|
||||||
state))}
|
state))}
|
||||||
[page-uuid block-id loaded-app set-loaded-app]
|
[page-uuid block-id loaded-app set-loaded-app]
|
||||||
(when-not (state/sub-async-query-loading (str page-uuid))
|
(when-not (state/sub-async-query-loading (str page-uuid))
|
||||||
|
|
Loading…
Reference in New Issue