Browse Source

fix: cleanup property related data

Tienson Qin 1 year ago
parent
commit
e19879a12a

+ 1 - 1
deps/db/src/logseq/db/frontend/property.cljs

@@ -278,7 +278,7 @@
 
 (defn get-pair-e
   [block db-ident]
-  (first (filter #(some? (db-ident %)) (:block/raw-properties block))))
+  (first (filter #(contains? (set (keys %)) db-ident) (:block/raw-properties block))))
 
 (defn get-block-property-value
   "Get the value of built-in block's property by its db-ident"

+ 1 - 0
src/main/frontend/handler/db_based/property.cljs

@@ -259,6 +259,7 @@
       db-attribute?
       (db/transact! repo [{:db/id (:db/id block) property-id v}]
         {:outliner-op :save-block})
+
       (and multiple-values? (coll? v))
       (reset-block-property-multiple-values! repo block-eid property-id v opts)
 

+ 4 - 5
src/main/frontend/worker/pipeline.cljs

@@ -132,12 +132,11 @@
                           (let [updated-blocks (remove (fn [b] (contains? (set deleted-block-uuids) (:block/uuid b)))
                                                        (concat pages blocks))
                                 tx-id (get-in tx-report [:tempids :db/current-tx])]
-                            (->>
-                             (map (fn [b]
+                            (keep (fn [b]
                                     (when-let [db-id (:db/id b)]
-                                      {:db/id db-id
-                                       :block/tx-id tx-id})) updated-blocks)
-                             (remove nil?))))
+                                      (when-not (:property/pair-property b)
+                                        {:db/id db-id
+                                         :block/tx-id tx-id}))) updated-blocks)))
               tx-report' (or
                           (when (seq replace-tx)
                           ;; TODO: remove this since transact! is really slow