enhance: Allow using config.edn to change if page redirect happens when inserting quick-capture (#7431)

* add option to edit config.edn for redirect to page upon inserting quick capture
pull/7456/head
hkgnp 2022-11-25 09:45:15 +08:00 committed by GitHub
parent 8f52021835
commit 77dc686e85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -160,6 +160,9 @@
insert-today? (get-in (state/get-config)
[:quick-capture-options :insert-today]
false)
redirect-page? (get-in (state/get-config)
[:quick-capture-options :redirect-page]
false)
today-page (when (state/enable-journals?)
(string/lower-case (date/today)))
page (if (or (= page "TODAY")
@ -195,7 +198,7 @@
(do
(when (not= page (state/get-current-page))
(page-handler/create! page {:redirect? true}))
(page-handler/create! page {:redirect? redirect-page?}))
(editor-handler/api-insert-new-block! content {:page page
:edit-block? true
:replace-empty-target? true}))))))