web/lib/device: fix ipad recognition

This commit is contained in:
wukko 2024-07-10 23:28:23 +06:00
parent d1767c550c
commit bc63b0c6b7
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -1,7 +1,7 @@
const ua = navigator.userAgent.toLowerCase();
const iPad = ua.includes("mac os") && navigator.maxTouchPoints > 0;
const iPhone = ua.includes("iphone os");
const iPad = !iPhone && ua.includes("mac os") && navigator.maxTouchPoints > 0;
const iOS = iPhone || iPad;
const android = ua.includes("android") || ua.includes("diordna");
@ -14,8 +14,8 @@ const installed = window.matchMedia('(display-mode: standalone)').matches;
const device = {
is: {
iPad,
iPhone,
iPad,
iOS,
android,
mobile,