Skip to content

Commit

Permalink
fix: remove current query block from query result view
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Dec 15, 2024
1 parent 392c947 commit 202be5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/frontend/components/query.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
(let [result (when *result (query-result/transform-query-result config q result'))
;; Remove hidden pages from result
result (if (and (coll? result) (not (map? result)))
(remove (fn [b] (when (and (map? b) (:block/title b)) (ldb/hidden? (:block/title b)))) result)
(->> result
(remove (fn [b] (when (and (map? b) (:block/title b)) (ldb/hidden? (:block/title b)))))
(remove (fn [b]
(when (and current-block (:db/id current-block)) (= (:db/id b) (:db/id current-block))))))
result)
;; Args for displaying query header and results
view-fn (if (keyword? view) (get-in (state/sub-config) [:query/views view]) view)
Expand Down

0 comments on commit 202be5c

Please sign in to comment.