fix: transaction

pull/9404/head
Tienson Qin 2023-05-15 15:16:24 +08:00
parent ea019bcad5
commit 95675269bc
2 changed files with 3 additions and 2 deletions

View File

@ -83,7 +83,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))
(not (contains? (:file/unlinked-dirs @state/state)

View File

@ -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#