mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 16:36:27 +00:00
fix(react): fix react warning (#753)
* fix(react): fix react warning * fix(foldeable): browser complains * fix(react): fix effects
This commit is contained in:
@@ -67,10 +67,15 @@
|
||||
(content/content page-name
|
||||
{:hiccup ref-hiccup}))])]]))))
|
||||
|
||||
(rum/defc unlinked-references-aux < rum/reactive db-mixins/query
|
||||
[page-name n-ref]
|
||||
(let [ref-blocks (db/get-page-unlinked-references page-name)]
|
||||
(reset! n-ref (count ref-blocks))
|
||||
(rum/defcs unlinked-references-aux
|
||||
< rum/reactive db-mixins/query
|
||||
{:will-mount (fn [state]
|
||||
(let [[page-name n-ref] (:rum/args state)
|
||||
ref-blocks (db/get-page-unlinked-references page-name)]
|
||||
(reset! n-ref (count ref-blocks))
|
||||
(assoc state ::ref-blocks ref-blocks)))}
|
||||
[state page-name n-ref]
|
||||
(let [ref-blocks (::ref-blocks state)]
|
||||
[:div.references-blocks
|
||||
(let [ref-hiccup (block/->hiccup ref-blocks
|
||||
{:id (str page-name "-unlinked-")
|
||||
@@ -95,6 +100,5 @@
|
||||
(if @n-ref
|
||||
(str @n-ref " Unlinked References")
|
||||
"Unlinked References")]
|
||||
(fn []
|
||||
(unlinked-references-aux page-name n-ref))
|
||||
(fn [] (unlinked-references-aux page-name n-ref))
|
||||
true)]]))))
|
||||
|
||||
Reference in New Issue
Block a user