Merge remote-tracking branch 'upstream/master' into whiteboards

This commit is contained in:
Peng Xiao
2022-09-01 10:29:29 +08:00
121 changed files with 6780 additions and 2084 deletions

View File

@@ -614,8 +614,13 @@
(when edit-block?
(if (and replace-empty-target?
(string/blank? (:block/content last-block)))
(js/setTimeout #(edit-block! last-block :max (:block/uuid last-block)) 10)
(js/setTimeout #(edit-block! new-block :max (:block/uuid new-block)) 10)))
;; 20ms of waiting for DOM to load the block, to avoid race condition.
;; It's ensuring good response under M1 pro
;; Used to be 10ms before, but is causing occasional failure on M1 pro with a full page of blocks,
;; or failing E2E with a small number of blocks.
;; Should be related to the # of elements in page
(js/setTimeout #(edit-block! last-block :max (:block/uuid last-block)) 20)
(js/setTimeout #(edit-block! new-block :max (:block/uuid new-block)) 20)))
new-block))))))
(defn insert-first-page-block-if-not-exists!