Przeglądaj źródła

fix(browser-support) fix detecting iOS browsers correctly

There was an error in the pattern match, everything was included in it. In
addition return a boolean in case we succeed in the UA pattern match, since it's
more correct than returning an array with the match.
dev1
Saúl Ibarra Corretgé 4 lat temu
rodzic
commit
c15dda1537
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2
    2
      modules/browser/BrowserCapabilities.js

+ 2
- 2
modules/browser/BrowserCapabilities.js Wyświetl plik

@@ -64,8 +64,8 @@ export default class BrowserCapabilities extends BrowserDetection {
64 64
     isIosBrowser() {
65 65
         const { userAgent, maxTouchPoints, platform } = navigator;
66 66
 
67
-        return userAgent.match(/iP(ad|hone|od)/i
68
-            || (maxTouchPoints && maxTouchPoints > 2 && /MacIntel/.test(platform)));
67
+        return Boolean(userAgent.match(/iP(ad|hone|od)/i))
68
+            || (maxTouchPoints && maxTouchPoints > 2 && /MacIntel/.test(platform));
69 69
     }
70 70
 
71 71
     /**

Ładowanie…
Anuluj
Zapisz