Merge branch 'master' into feat/db

pull/10050/head
Tienson Qin 2023-08-16 00:41:47 +08:00
commit 517505cf53
2 changed files with 17 additions and 11 deletions

View File

@ -2065,7 +2065,7 @@
sorted-blocks
(drop 1 sorted-blocks))]
(when element-id
(insert-command! element-id "" format {}))
(insert-command! element-id "" format {:end-pattern commands/command-trigger}))
(let [exclude-properties [:id :template :template-including-parent]
content-update-fn (fn [content]
(->> content
@ -2087,15 +2087,21 @@
:else
true)]
(outliner-tx/transact!
{:outliner-op :insert-blocks
:created-from-journal-template? journal?}
(save-current-block!)
(let [result (outliner-core/insert-blocks! blocks'
target
(assoc opts
:sibling? sibling?'))]
(edit-last-block-after-inserted! result))))))))
(try
(outliner-tx/transact!
{:outliner-op :insert-blocks
:created-from-journal-template? journal?}
(save-current-block!)
(let [result (outliner-core/insert-blocks! blocks'
target
(assoc opts
:sibling? sibling?'))]
(edit-last-block-after-inserted! result)))
(catch :default ^js/Error e
(notification/show!
[:p.content
(util/format "Template insert error: %s" (.-message e))]
:error))))))))
(defn template-on-chosen-handler
[element-id]

View File

@ -75,7 +75,7 @@
(redirect-to-page! page-name {}))
([page-name {:keys [anchor push click-from-recent?]
:or {click-from-recent? false}}]
(when (seq page-name)
(when (or (uuid? page-name) (seq page-name))
(recent-handler/add-page-to-recent! (state/get-current-repo) page-name
click-from-recent?)
(let [m (cond->