mirror of https://github.com/logseq/logseq
fix: try to address duplicated journals
related to https://github.com/logseq/logseq/issues/595pull/645/head
parent
c88c1ee685
commit
9488ee2e03
|
@ -1872,14 +1872,16 @@
|
|||
|
||||
(defn cloned?
|
||||
[repo-url]
|
||||
(->
|
||||
(d/q '[:find ?cloned
|
||||
:in $ ?repo-url
|
||||
:where
|
||||
[?repo :repo/url ?repo-url]
|
||||
[?repo :repo/cloned? ?cloned]]
|
||||
(get-conn repo-url) repo-url)
|
||||
ffirst))
|
||||
(when-let [conn (get-conn repo-url)]
|
||||
(->
|
||||
(d/q '[:find ?cloned
|
||||
:in $ ?repo-url
|
||||
:where
|
||||
[?repo :repo/url ?repo-url]
|
||||
[?repo :repo/cloned? ?cloned]]
|
||||
conn
|
||||
repo-url)
|
||||
ffirst)))
|
||||
|
||||
(defn reset-config!
|
||||
[repo-url content]
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
(js/setInterval (fn []
|
||||
(state/set-today! (date/today))
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(let [today-page (string/lower-case (date/today))]
|
||||
(when (empty? (db/get-page-blocks-no-cache repo today-page))
|
||||
(repo-handler/create-today-journal-if-not-exists repo)))))
|
||||
(when (db/cloned? repo)
|
||||
(let [today-page (string/lower-case (date/today))]
|
||||
(when (empty? (db/get-page-blocks-no-cache repo today-page))
|
||||
(repo-handler/create-today-journal-if-not-exists repo))))))
|
||||
1000))
|
||||
|
||||
(defn restore-and-setup!
|
||||
|
@ -70,7 +71,7 @@
|
|||
(or force?
|
||||
(and (state/get-edit-input-id)
|
||||
(> (- (util/time-ms) last-stored-at) (* 5 60 1000)) ; 5 minutes
|
||||
)
|
||||
)
|
||||
(nil? (state/get-edit-input-id))))
|
||||
(p/let [_ (repo-handler/persist-repo! repo)]
|
||||
(state/update-repo-last-stored-at! repo)))))))
|
||||
|
|
Loading…
Reference in New Issue