mirror of
https://github.com/logseq/logseq.git
synced 2026-05-19 02:12:41 +00:00
Merge branch 'master' into enhance/i18n
This commit is contained in:
@@ -36,6 +36,22 @@
|
||||
(rest parts)))
|
||||
(string/join " #"))))
|
||||
|
||||
(defn- find-page-add-button
|
||||
[page-id]
|
||||
(when page-id
|
||||
(->> (dom/sel ".block-add-button")
|
||||
(filter #(= (str page-id) (dom/attr % "parentblockid")))
|
||||
first)))
|
||||
|
||||
(defn- click-page-add-button-with-retry!
|
||||
[page-id]
|
||||
(letfn [(poll! [remaining-ms]
|
||||
(if-let [block-add-button (find-page-add-button page-id)]
|
||||
(.click block-add-button)
|
||||
(when (pos? remaining-ms)
|
||||
(js/setTimeout #(poll! (- remaining-ms 100)) 100))))]
|
||||
(poll! 500)))
|
||||
|
||||
(defn <create!
|
||||
([title]
|
||||
(<create! title {}))
|
||||
@@ -82,13 +98,7 @@
|
||||
(when redirect?
|
||||
(route-handler/redirect-to-page! page-uuid)
|
||||
(when-not today-journal?
|
||||
(js/setTimeout
|
||||
(fn []
|
||||
(when-let [block-add-button (->> (dom/sel ".block-add-button")
|
||||
(filter #(= (str (:db/id page)) (dom/attr % "parentblockid")))
|
||||
first)]
|
||||
(.click block-add-button)))
|
||||
200)))
|
||||
(click-page-add-button-with-retry! (:db/id page))))
|
||||
page)))))))))
|
||||
|
||||
;; favorite fns
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
(defn- ws-open? [ws]
|
||||
(sync-transport/ws-open? ws))
|
||||
|
||||
(defn- upload-large-title! [repo graph-id title aes-key]
|
||||
(defn upload-large-title! [repo graph-id title aes-key]
|
||||
(sync-large-title/upload-large-title!
|
||||
{:repo repo
|
||||
:graph-id graph-id
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
:process-batch-f
|
||||
(fn [batch]
|
||||
(p/let [datoms* (sync-large-title/offload-large-titles-in-datoms-batch
|
||||
repo graph-id batch aes-key sync-large-title/upload-large-title!)
|
||||
repo graph-id batch aes-key sync-apply/upload-large-title!)
|
||||
encrypted-datoms (if aes-key
|
||||
(sync-crypt/<encrypt-datoms aes-key datoms*)
|
||||
datoms*)
|
||||
|
||||
Reference in New Issue
Block a user