fix(mobile): swipe on node link opens the node

This commit is contained in:
Tienson Qin
2025-12-16 14:57:27 +08:00
parent 52dae0feed
commit 135878a78f

View File

@@ -363,8 +363,11 @@
(reset! *swiped? true)
(dom/set-style! block-container :transform (util/format "translateX(%dpx)" left)))))))))))))
(defonce ^:private *swipe-timeout (atom nil))
(defn on-touch-end
[event]
(when-let [timeout @*swipe-timeout]
(js/clearTimeout timeout))
(util/stop-propagation event)
(when @*swipe
(let [target (.-target event)
@@ -389,10 +392,11 @@
(when (:mobile/show-action-bar? @state/state)
(state/set-state! :mobile/show-action-bar? false)))
(haptics/haptics)))
(reset! *swiped? false)
(catch :default e
(js/console.error e))
(finally
(reset! *swipe-timeout
(js/setTimeout #(reset! *swiped? false) 50))
(reset! *swipe nil)
(reset! *touch-start nil))))))