From 48904e03f35d539657cc01000a8b3aeb6be5de6d Mon Sep 17 00:00:00 2001 From: jtemplej Date: Tue, 3 Mar 2020 11:27:37 +0900 Subject: [PATCH] compatible with IE --- src/components/helpers/get-ua-data.js | 2 +- src/components/helpers/selectors.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/helpers/get-ua-data.js b/src/components/helpers/get-ua-data.js index c4d6904..6788036 100644 --- a/src/components/helpers/get-ua-data.js +++ b/src/components/helpers/get-ua-data.js @@ -30,6 +30,6 @@ export const getNavigatorInstance = () => { export const isIOS13Check = type => { const nav = getNavigatorInstance(); return ( - nav && (nav.platform.includes(type) || (nav.platform === 'MacIntel' && nav.maxTouchPoints > 1 && !window.MSStream)) + nav && (nav.platform.indexOf(type) !== -1 || (nav.platform === 'MacIntel' && nav.maxTouchPoints > 1 && !window.MSStream)) ); }; diff --git a/src/components/helpers/selectors.js b/src/components/helpers/selectors.js index b599ba9..b0dead6 100644 --- a/src/components/helpers/selectors.js +++ b/src/components/helpers/selectors.js @@ -34,7 +34,7 @@ const isElectronType = () => { const nav = getNavigatorInstance(); const ua = nav && nav.userAgent.toLowerCase(); - return typeof ua === 'string' ? ua.includes('electron') : false; + return typeof ua === 'string' ? /electron/.test(ua) : false; }; const getIOS13 = () => {