diff options
author | Bas van den Wollenberg <hi@bas.sh> | 2025-03-24 20:07:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-24 12:07:56 -0700 |
commit | 6a5770ee8919cda072504da4742ccabc7c3d1562 (patch) | |
tree | d7ad6186023f17ec011947082e8f8f65b1b05fbb | |
parent | 7daf7a703ef29ca5543e14189a4f019123d1f1e3 (diff) | |
download | voidsky-6a5770ee8919cda072504da4742ccabc7c3d1562.tar.zst |
change touch device detection method (#5919)
-rw-r--r-- | src/lib/browser.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/browser.ts b/src/lib/browser.ts index 08c43fbfd..36563ee75 100644 --- a/src/lib/browser.ts +++ b/src/lib/browser.ts @@ -3,7 +3,6 @@ export const isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent, ) export const isFirefox = /firefox|fxios/i.test(navigator.userAgent) -export const isTouchDevice = - 'ontouchstart' in window || navigator.maxTouchPoints > 1 +export const isTouchDevice = window.matchMedia('(pointer: coarse)').matches export const isAndroidWeb = /android/i.test(navigator.userAgent) && isTouchDevice |