feat: treat large-screen devices as non-touch

This commit is contained in:
codytseng 2026-01-19 21:55:48 +08:00
parent 71791c9513
commit 0d6f8789d0

View file

@ -37,6 +37,8 @@ export function isTorBrowser() {
} }
export function isTouchDevice() { export function isTouchDevice() {
// treat all large screen devices as non-touch devices
if (window.innerWidth > 768) return false
if (typeof window === 'undefined' || !window.navigator) return false if (typeof window === 'undefined' || !window.navigator) return false
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 return 'ontouchstart' in window || navigator.maxTouchPoints > 0
} }