Fix Bug 2121: NG-UI uses unmaintained Chokidar version
[osm/NG-UI.git] / src / services / DeviceCheckService.ts
index 98ab2fc..cf4d5dd 100644 (file)
@@ -38,12 +38,12 @@ export class DeviceCheckService {
 
     /** Return the Device type @public */
     public checkDeviceType(): void {
-        if (navigator.userAgent.match(/Android/i)
-            || navigator.userAgent.match(/webOS/i)
-            || navigator.userAgent.match(/iPhone/i)
-            || navigator.userAgent.match(/iPod/i)
-            || navigator.userAgent.match(/BlackBerry/i)
-            || navigator.userAgent.match(/Windows Phone/i)) {
+        if ((/Android/i.exec(navigator.userAgent))
+            || (/webOS/i.exec(navigator.userAgent))
+            || (/iPhone/i.exec(navigator.userAgent))
+            || (/iPod/i.exec(navigator.userAgent))
+            || (/BlackBerry/i.exec(navigator.userAgent))
+            || (/Windows Phone/i.exec(navigator.userAgent))) {
             this.isMobile$.next(true);
         } else {
             this.isMobile$.next(false);