mirror of https://github.com/logseq/logseq
fix: don't create journal's file when it was initialized by a template
parent
21ff600c21
commit
8b0f83d3ab
|
@ -2017,7 +2017,8 @@
|
|||
(when-let [db-id (if (integer? db-id)
|
||||
db-id
|
||||
(:db/id (db-model/get-template-by-name (name db-id))))]
|
||||
(let [repo (state/get-current-repo)
|
||||
(let [journal? (:block/journal? target)
|
||||
repo (state/get-current-repo)
|
||||
target (or target (state/get-edit-block))
|
||||
block (db/entity db-id)
|
||||
format (:block/format block)
|
||||
|
@ -2060,11 +2061,13 @@
|
|||
:else
|
||||
true)]
|
||||
(outliner-tx/transact!
|
||||
{:outliner-op :insert-blocks}
|
||||
{:outliner-op :insert-blocks
|
||||
:created-from-journal-template? journal?}
|
||||
(save-current-block!)
|
||||
(let [result (outliner-core/insert-blocks! blocks'
|
||||
target
|
||||
(assoc opts :sibling? sibling?'))]
|
||||
(assoc opts
|
||||
:sibling? sibling?'))]
|
||||
(edit-last-block-after-inserted! result))))))))
|
||||
|
||||
(defn template-on-chosen-handler
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
[clojure.set :as set]))
|
||||
|
||||
(defn updated-page-hook
|
||||
[_tx-report page]
|
||||
(file/sync-to-file page))
|
||||
[tx-report page]
|
||||
(when-not (get-in tx-report [:tx-meta :created-from-journal-template?])
|
||||
(file/sync-to-file page)))
|
||||
|
||||
;; TODO: it'll be great if we can calculate the :block/path-refs before any
|
||||
;; outliner transaction, this way we can group together the real outliner tx
|
||||
|
|
Loading…
Reference in New Issue