File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11// https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system
22export const isMobile = ( ) => {
3+ if ( typeof navigator === 'undefined' ) return false ;
4+
35 // @ts -ignore
4- var userAgent : string = navigator ? .userAgent || navigator ? .vendor || window ?. opera ;
6+ var userAgent : string = navigator . userAgent || navigator . vendor || window ?. opera ;
57
68 if ( / a n d r o i d / i. test ( userAgent ) )
79 return true ;
Original file line number Diff line number Diff line change 1- // @ts -ignore
2- export const isMac = / m a c / i. test ( navigator ?. userAgentData ? navigator . userAgentData . platform : navigator ?. platform ) ;
1+ export const isMac = typeof navigator !== 'undefined' &&
2+ // @ts -ignore
3+ / m a c / i. test ( navigator . userAgentData ? navigator . userAgentData . platform : navigator . platform ) ;
You can’t perform that action at this time.
0 commit comments