Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: page linked refs start closed when 10+ #2179

Merged
merged 1 commit into from
May 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/cljs/athens/views/pages/node_page.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -298,16 +298,13 @@


(defn linked-ref-el
[state title]
(let [linked? "Linked References"
linked-refs (wrap-span-no-new-tx "get-reactive-linked-references"
[title]
(let [linked-refs (wrap-span-no-new-tx "get-reactive-linked-references"
(reactive/get-reactive-linked-references [:node/title title]))]
(when (not-empty linked-refs)
[:> PageReferences {:count (count linked-refs)
:title "Linked References"
:onOpen (fn [] (swap! state update linked? not))
:onClose (fn [] (swap! state update linked? not))
:defaultIsOpen (get @state linked?)}
:defaultIsOpen (> 10 (count linked-refs))}
(doall
(for [[group-title group] linked-refs]
[:> ReferenceGroup {:key (str "group-" group-title)
Expand Down Expand Up @@ -467,7 +464,7 @@
[:> PageFooter
[:> VStack {:spacing 2 :py 4 :align "stretch"}
[perf-mon/hoc-perfmon-no-new-tx {:span-name "linked-ref-el"}
[linked-ref-el state title]]
[linked-ref-el title]]
(when-not on-daily-notes?
[perf-mon/hoc-perfmon-no-new-tx {:span-name "unlinked-ref-el"}
[unlinked-ref-el state unlinked-refs title]])]]]))))
Expand Down