Explorar o código

fix: linked References Filter Empty

close #7788
Tienson Qin %!s(int64=3) %!d(string=hai) anos
pai
achega
3f01f66214
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      src/main/frontend/db/model.cljs

+ 9 - 2
src/main/frontend/db/model.cljs

@@ -1231,10 +1231,17 @@ independent of format as format specific heading characters are stripped"
             {:use-cache? false
              :query-fn (fn []
                          (let [entities (mapcat (fn [id]
-                                                  (:block/_path-refs (db-utils/entity id))) pages)]
-                           (db-utils/pull-many '[*] (map :db/id entities))))}
+                                                  (:block/_path-refs (db-utils/entity id))) pages)
+                               blocks (map (fn [e]
+                                             {:block/parent (:block/parent e)
+                                              :block/left (:block/left e)
+                                              :block/page (:block/page e)
+                                              :block/collapsed? (:block/collapsed? e)}) entities)]
+                           {:entities entities
+                            :blocks blocks}))}
             nil)
           react
+          :entities
           (remove (fn [block] (= page-id (:db/id (:block/page block)))))))))))
 
 (defn get-date-scheduled-or-deadlines