summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-10-15 14:16:33 +0200
committerJules Laplace <julescarbon@gmail.com>2021-10-15 14:16:33 +0200
commitb2c6a37430438c72a0fee45bc2d538875f2f803e (patch)
tree6830db03f1e7907c5537c74528190d6b3b7a4a5c /src/utils
parent467c9335c16c701d0d7e04af39b858bbfe54db96 (diff)
update db
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/index.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/utils/index.js b/src/utils/index.js
index 7c4ca54..48c90af 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -21,10 +21,19 @@ export const capitalize = (text = "") =>
/* Mobile check */
+function isIpadOS() {
+ return (
+ navigator.userAgent.match(/iPad/i) ||
+ (navigator.maxTouchPoints &&
+ navigator.maxTouchPoints > 2 &&
+ /MacIntel/.test(navigator.platform))
+ );
+}
+
export const isiPhone = !!(
navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)
);
-export const isiPad = !!navigator.userAgent.match(/iPad/i);
+export const isiPad = isIpadOS();
export const isAndroid = !!navigator.userAgent.match(/Android/i);
export const isMobile = isiPhone || isiPad || isAndroid;
export const isDesktop = !isMobile;