mirror of https://github.com/logseq/logseq
Merge branch 'feat/outliner-core' of github.com:logseq/logseq into feat/outliner-core
commit
a884c84f20
|
@ -2363,6 +2363,7 @@
|
|||
[e]
|
||||
(cut-blocks-and-clear-selections! false))
|
||||
|
||||
;; credits to @pengx17
|
||||
(defn- copy-current-block-ref
|
||||
[]
|
||||
(when-let [current-block (state/get-edit-block)]
|
||||
|
|
|
@ -380,8 +380,7 @@
|
|||
(tree/-save txs-state)))
|
||||
(some-> last-node-right
|
||||
(tree/-set-left-id first-node-left-id)
|
||||
(tree/-save txs-state))
|
||||
(outliner-file/sync-to-file (get-data first-node))))
|
||||
(tree/-save txs-state))))
|
||||
(when-not (first-level? first-node)
|
||||
(let [parent (tree/-get-parent first-node)
|
||||
parent-parent-id (tree/-get-parent-id parent)
|
||||
|
|
|
@ -32,3 +32,19 @@
|
|||
(async/put! write-chan page-db-id))
|
||||
|
||||
(util/batch write-chan batch-write-interval write-files!)
|
||||
|
||||
(defn batch [in max-time handler]
|
||||
(async/go-loop [buf [] t (async/timeout max-time)]
|
||||
(let [[v p] (async/alts! [in t])]
|
||||
(cond
|
||||
(= p t)
|
||||
(do
|
||||
(handler buf)
|
||||
(recur [] (async/timeout max-time)))
|
||||
|
||||
(nil? v) ; stop
|
||||
(when (seq buf)
|
||||
(handler buf))
|
||||
|
||||
:else
|
||||
(recur (conj buf v) t)))))
|
||||
|
|
Loading…
Reference in New Issue