mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: transact today's journal tx-data iff it doesn't exists yet
This commit is contained in:
@@ -77,7 +77,8 @@
|
||||
[frontend.persist-db.browser :as db-browser]
|
||||
[frontend.db.rtc.debug-ui :as rtc-debug-ui]
|
||||
[frontend.modules.outliner.pipeline :as pipeline]
|
||||
[electron.ipc :as ipc]))
|
||||
[electron.ipc :as ipc]
|
||||
[frontend.date :as date]))
|
||||
|
||||
;; TODO: should we move all events here?
|
||||
|
||||
@@ -347,7 +348,9 @@
|
||||
(page-handler/rename! old-title new-title))
|
||||
|
||||
(defmethod handle :page/create [[_ page-name opts]]
|
||||
(page-handler/create! page-name opts))
|
||||
(if (= page-name (date/today))
|
||||
(page-handler/create-today-journal!)
|
||||
(page-handler/create! page-name opts)))
|
||||
|
||||
(defmethod handle :page/deleted [[_ repo page-name file-path]]
|
||||
(page-common-handler/after-page-deleted! repo page-name file-path))
|
||||
|
||||
@@ -286,10 +286,12 @@
|
||||
(create! title {:redirect? false
|
||||
:split-namespace? false
|
||||
:create-first-block? (not template)
|
||||
:journal? true})
|
||||
(state/pub-event! [:journal/insert-template today-page])
|
||||
(ui-handler/re-render-root!)
|
||||
(plugin-handler/hook-plugin-app :today-journal-created {:title today-page}))]
|
||||
:journal? true
|
||||
:today-journal? true})
|
||||
(js/setTimeout #(do
|
||||
(state/pub-event! [:journal/insert-template today-page])
|
||||
(ui-handler/re-render-root!)
|
||||
(plugin-handler/hook-plugin-app :today-journal-created {:title today-page})) 100))]
|
||||
(when (db/page-empty? repo today-page)
|
||||
(if (config/db-based-graph? repo)
|
||||
(let [page-exists (db/get-page today-page)]
|
||||
|
||||
Reference in New Issue
Block a user