We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b4c883 commit 2393f51Copy full SHA for 2393f51
ui/Browser.tsx
@@ -7,15 +7,17 @@ const maybeWindow =
7
typeof window === 'undefined'
8
? {
9
HTMLElement: false,
10
- navigator: { userAgent: '' },
+ navigator: { maxTouchPoints: 0, userAgent: '' },
11
safari: null,
12
}
13
: window;
14
15
-export const isIPhone = /iphone/i.test(maybeWindow.navigator.userAgent);
+const navigator = maybeWindow.navigator;
16
+
17
+export const isIPhone = /iphone/i.test(navigator.userAgent);
18
19
export const isIOS =
- !!maybeWindow.navigator.userAgent.match(/i(?:pad|phone)/i) ||
20
+ !!navigator.userAgent.match(/i(?:pad|phone)/i) ||
21
(/(macintosh|macintel|macppc|mac68k|macos)/i.test(navigator.userAgent) &&
22
navigator.maxTouchPoints > 0);
23
0 commit comments