mirror of https://github.com/logseq/logseq
fix: empty transact to notify batch-tx exit
parent
bffd1b5c8e
commit
03246325b3
|
@ -13,4 +13,5 @@
|
|||
~@body
|
||||
(when (seq ~additional-tx)
|
||||
(logseq.db/transact! ~conn ~additional-tx {}))
|
||||
(datascript.core/transact! ~conn [] {:batch-tx/exit? true})
|
||||
(frontend.worker.batch-tx/exit-batch-txs-mode!))))
|
||||
|
|
|
@ -68,10 +68,9 @@
|
|||
(d/unlisten! conn ::listen-db-changes!)
|
||||
(d/listen! conn ::listen-db-changes!
|
||||
(fn [{:keys [tx-data _db-before _db-after tx-meta] :as tx-report}]
|
||||
(let [pipeline-replace? (:pipeline-replace? tx-meta)
|
||||
batch-processing? (some? (batch-tx/get-batch-db-before))]
|
||||
(let [pipeline-replace? (:pipeline-replace? tx-meta)]
|
||||
(when-not pipeline-replace?
|
||||
(if batch-processing?
|
||||
(if-not (:batch-tx/exit? tx-meta)
|
||||
(batch-tx/conj-batch-txs! tx-data)
|
||||
(let [;; exiting-batch-mode? (> (:batch-tx/counter (d/entity db-before :logseq.kv/tx-batch-counter)) 0)
|
||||
db-before (batch-tx/get-batch-db-before)
|
||||
|
@ -79,9 +78,9 @@
|
|||
|
||||
;; (:db-before tx-report))
|
||||
|
||||
tx-data (batch-tx/get-batch-txs);; (if exiting-batch-mode?
|
||||
tx-data (batch-tx/get-batch-txs) ;; (if exiting-batch-mode?
|
||||
|
||||
;; (concat (:tx-data tx-report) tx-data))
|
||||
;; (concat (:tx-data tx-report) tx-data))
|
||||
tx-report (assoc tx-report
|
||||
:db-before db-before
|
||||
:tx-data tx-data)
|
||||
|
|
Loading…
Reference in New Issue