浏览代码

fix: transaction

Tienson Qin 2 年之前
父节点
当前提交
2d705b6979

+ 2 - 1
src/main/frontend/modules/outliner/datascript.cljc

@@ -85,7 +85,8 @@
                                       :block/title :block/body :block/level :block/container :db/other-tx
                                       :block/additional-properties)
                               m)) txs)
-           txs (update-block-refs txs opts)]
+           txs (-> (update-block-refs txs opts)
+                   (distinct))]
        (when (and (seq txs)
                   (not (:skip-transact? opts))
                   (if (react/db-graph? repo)

+ 1 - 1
src/main/frontend/modules/outliner/transaction.cljc

@@ -45,7 +45,7 @@
                full-opts# (apply merge (reverse o#))
                opts## (merge (dissoc full-opts# :additional-tx :current-block :nested-transaction?) tx-meta#)]
            (when (seq all-tx#) ;; If it's empty, do nothing
-             (when-not (:nested-transaction? opts##) ; transact only for the whole transaction
+             (when-not (:nested-transaction? opts#) ; transact only for the whole transaction
                (let [result# (frontend.modules.outliner.datascript/transact! all-tx# opts## before-editor-cursor#)]
                  {:tx-report result#
                   :tx-data all-tx#