From 202be5cc7b374bb7eb5cb9119ddb192df9e78f76 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sun, 15 Dec 2024 16:19:40 +0800 Subject: [PATCH] fix: remove current query block from query result view --- src/main/frontend/components/query.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/components/query.cljs b/src/main/frontend/components/query.cljs index cd660dcb667..5d9467c937d 100644 --- a/src/main/frontend/components/query.cljs +++ b/src/main/frontend/components/query.cljs @@ -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)