mirror of
https://github.com/logseq/logseq.git
synced 2026-05-23 20:24:15 +00:00
fix: don't show query component when a block doesn't have a query
fixes https://github.com/logseq/db-test/issues/544 The root cause is that a page/block extends #Query, we probably should disallow this behavior.
This commit is contained in:
@@ -3827,14 +3827,15 @@
|
||||
query (:block/title query-block)
|
||||
result (common-util/safe-read-string {:log-error? false} query)
|
||||
advanced-query? (map? result)]
|
||||
[:div {:style {:padding-left 42}}
|
||||
(query/custom-query (wrap-query-components (assoc config
|
||||
:dsl-query? (not advanced-query?)
|
||||
:cards? (ldb/class-instance? (entity-plus/entity-memoized
|
||||
(db/get-db)
|
||||
:logseq.class/Cards) block)))
|
||||
(if advanced-query? result {:builder nil
|
||||
:query (query-builder-component/sanitize-q query)}))]))
|
||||
(when query-block
|
||||
[:div {:style {:padding-left 42}}
|
||||
(query/custom-query (wrap-query-components (assoc config
|
||||
:dsl-query? (not advanced-query?)
|
||||
:cards? (ldb/class-instance? (entity-plus/entity-memoized
|
||||
(db/get-db)
|
||||
:logseq.class/Cards) block)))
|
||||
(if advanced-query? result {:builder nil
|
||||
:query (query-builder-component/sanitize-q query)}))])))
|
||||
|
||||
(when-not (or (:hide-children? config) in-whiteboard? (or table? property?))
|
||||
(let [config' (-> (update config :level inc)
|
||||
|
||||
Reference in New Issue
Block a user