perf: slow switch to the editor mode for long pages

This commit is contained in:
Tienson Qin
2023-09-07 00:12:06 +08:00
parent a23068fec7
commit 0cbd6c09f8
10 changed files with 35 additions and 29 deletions

View File

@@ -108,7 +108,7 @@
(when-let [touches (.-targetTouches event)]
(let [selection-type (.-type (.getSelection js/document))]
(when-not (= selection-type "Range")
(when (or (not (state/sub :editor/editing?))
(when (or (not (state/sub :editor/editing))
(< (- (js/Date.now) @*touch-start) 600))
(when (and (= (.-length touches) 1) @*swipe)
(let [{:keys [x0 xi direction]} @*swipe