mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: page refs not saved in quick capture
This commit is contained in:
20
deps/outliner/src/logseq/outliner/core.cljs
vendored
20
deps/outliner/src/logseq/outliner/core.cljs
vendored
@@ -718,15 +718,17 @@
|
||||
(if-let [eid (or (:db/id b)
|
||||
(when-let [id (:block/uuid b)]
|
||||
[:block/uuid id]))]
|
||||
(->
|
||||
(if-let [e (if (de/entity? b) b (d/entity db eid))]
|
||||
(merge
|
||||
(into {} e)
|
||||
{:db/id (:db/id e)
|
||||
:block/title (or (:block/raw-title e) (:block/title e))}
|
||||
b)
|
||||
b)
|
||||
(dissoc :block/tx-id :block/refs :block/path-refs))
|
||||
(let [b (if-let [e (if (de/entity? b) b (d/entity db eid))]
|
||||
(merge
|
||||
(into {} e)
|
||||
{:db/id (:db/id e)
|
||||
:block/title (or (:block/raw-title e) (:block/title e))}
|
||||
b)
|
||||
b)
|
||||
dissoc-keys (concat [:block/tx-id :block/path-refs]
|
||||
(when (contains? #{:insert-template-blocks :paste} outliner-op)
|
||||
[:block/refs]))]
|
||||
(apply dissoc b dissoc-keys))
|
||||
b))
|
||||
blocks)
|
||||
[target-block sibling?] (get-target-block db blocks target-block opts)
|
||||
|
||||
@@ -597,31 +597,31 @@
|
||||
(wrap-parse-block)
|
||||
(assoc :block/uuid (or custom-uuid (db/new-block-id))))
|
||||
new-block (merge new-block other-attrs)
|
||||
[block-m sibling?] (cond
|
||||
before?
|
||||
(let [left-or-parent (or (ldb/get-left-sibling block)
|
||||
(:block/parent block))
|
||||
sibling? (if (= (:db/id (:block/parent block)) (:db/id left-or-parent))
|
||||
false sibling?)]
|
||||
[left-or-parent sibling?])
|
||||
[target-block sibling?] (cond
|
||||
before?
|
||||
(let [left-or-parent (or (ldb/get-left-sibling block)
|
||||
(:block/parent block))
|
||||
sibling? (if (= (:db/id (:block/parent block)) (:db/id left-or-parent))
|
||||
false sibling?)]
|
||||
[left-or-parent sibling?])
|
||||
|
||||
sibling?
|
||||
[(db/entity (:db/id block)) sibling?]
|
||||
sibling?
|
||||
[(db/entity (:db/id block)) sibling?]
|
||||
|
||||
last-block
|
||||
[last-block true]
|
||||
last-block
|
||||
[last-block true]
|
||||
|
||||
block
|
||||
[(db/entity (:db/id block)) sibling?]
|
||||
block
|
||||
[(db/entity (:db/id block)) sibling?]
|
||||
|
||||
;; FIXME: assert
|
||||
:else
|
||||
nil)]
|
||||
(when block-m
|
||||
;; FIXME: assert
|
||||
:else
|
||||
nil)]
|
||||
(when target-block
|
||||
(p/do!
|
||||
(ui-outliner-tx/transact!
|
||||
{:outliner-op :insert-blocks}
|
||||
(outliner-insert-block! config block-m new-block
|
||||
(outliner-insert-block! config target-block new-block
|
||||
{:sibling? sibling?
|
||||
:keep-uuid? true
|
||||
:ordered-list? ordered-list?
|
||||
|
||||
@@ -93,7 +93,8 @@
|
||||
(let [result (outliner-core/insert-blocks
|
||||
repo db template-blocks object
|
||||
{:sibling? false
|
||||
:keep-uuid? journal-template?})]
|
||||
:keep-uuid? journal-template?
|
||||
:outliner-op :insert-template-blocks})]
|
||||
(:tx-data result)))))))]
|
||||
tx-data))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user