From b2c6a37430438c72a0fee45bc2d538875f2f803e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 15 Oct 2021 14:16:33 +0200 Subject: update db --- src/utils/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/utils') 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; -- cgit v1.2.3-70-g09d2