File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export const mockUserAgent = userAgent => {
1717export const setDefaults = ( p , d = "none" ) => ( p ? p : d ) ;
1818
1919export const isIOS13Check = type => {
20- return (
20+ return navigator && (
2121 navigator . platform . includes ( type ) ||
2222 ( navigator . platform === "MacIntel" &&
2323 navigator . maxTouchPoints > 1 &&
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ const isIEType = () =>
4343 browser . name === BROWSER_TYPES . INTERNET_EXPLORER ||
4444 browser . name === BROWSER_TYPES . IE ;
4545const isElectronType = ( ) => {
46- const ua = navigator . userAgent . toLowerCase ( )
46+ const ua = navigator && navigator . userAgent . toLowerCase ( )
4747
48- return ua . includes ( 'electron' )
48+ return typeof ua === 'string' ? ua . includes ( 'electron' ) : false
4949}
5050
5151const getIOS13 = ( ) => {
52- return (
52+ return navigator && (
5353 ( / i P a d | i P h o n e | i P o d / . test ( navigator . platform ) ||
5454 ( navigator . platform === "MacIntel" && navigator . maxTouchPoints > 1 ) ) &&
5555 ! window . MSStream
You can’t perform that action at this time.
0 commit comments