Skip to content

Commit

Permalink
perf: collapse today queries for db graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Dec 12, 2024
1 parent f289988 commit 5a4a1f0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/main/frontend/components/page.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,18 @@
(when (seq queries)
[:div#today-queries.mt-10
(for [query queries]
(rum/with-key
(ui/catch-error
(ui/component-error "Failed default query:" {:content (pr-str query)})
(query/custom-query (component-block/wrap-query-components
{:attr {:class "mt-10"}
:editor-box editor/box
:page page-cp})
query))
(str repo "-custom-query-" (:query query))))]))))
(let [query' (if (config/db-based-graph?)
(assoc query :collapsed? true)
query)]
(rum/with-key
(ui/catch-error
(ui/component-error "Failed default query:" {:content (pr-str query')})
(query/custom-query (component-block/wrap-query-components
{:attr {:class "mt-10"}
:editor-box editor/box
:page page-cp})
query'))
(str repo "-custom-query-" (:query query')))))]))))

(rum/defc tagged-pages
[repo tag tag-title]
Expand Down

0 comments on commit 5a4a1f0

Please sign in to comment.