mirror of https://github.com/logseq/logseq
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 capturepull/7456/head
parent
8f52021835
commit
77dc686e85
|
@ -160,6 +160,9 @@
|
||||||
insert-today? (get-in (state/get-config)
|
insert-today? (get-in (state/get-config)
|
||||||
[:quick-capture-options :insert-today]
|
[:quick-capture-options :insert-today]
|
||||||
false)
|
false)
|
||||||
|
redirect-page? (get-in (state/get-config)
|
||||||
|
[:quick-capture-options :redirect-page]
|
||||||
|
false)
|
||||||
today-page (when (state/enable-journals?)
|
today-page (when (state/enable-journals?)
|
||||||
(string/lower-case (date/today)))
|
(string/lower-case (date/today)))
|
||||||
page (if (or (= page "TODAY")
|
page (if (or (= page "TODAY")
|
||||||
|
@ -195,7 +198,7 @@
|
||||||
|
|
||||||
(do
|
(do
|
||||||
(when (not= page (state/get-current-page))
|
(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
|
(editor-handler/api-insert-new-block! content {:page page
|
||||||
:edit-block? true
|
:edit-block? true
|
||||||
:replace-empty-target? true}))))))
|
:replace-empty-target? true}))))))
|
||||||
|
|
Loading…
Reference in New Issue