Apply suggestions from code review

This commit is contained in:
Dmitry Lyzo 2019-11-14 16:29:33 +03:00
parent cdfa115ec0
commit 11b6e83d69

View File

@ -122,6 +122,7 @@ define([], function () {
} }
function iOSversion() { function iOSversion() {
// MacIntel: Apple iPad Pro 11 iOS 13.1
if (/iP(hone|od|ad)|MacIntel/.test(navigator.platform)) { if (/iP(hone|od|ad)|MacIntel/.test(navigator.platform)) {
// supports iOS 2.0 and later: <http://bit.ly/TJjs1V> // supports iOS 2.0 and later: <http://bit.ly/TJjs1V>
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
@ -301,7 +302,10 @@ define([], function () {
if (browser.iOS) { if (browser.iOS) {
browser.iOSVersion = iOSversion(); browser.iOSVersion = iOSversion();
browser.iOSVersion = browser.iOSVersion[0] + (browser.iOSVersion[1] / 10);
if (browser.iOSVersion && browser.iOSVersion.length >= 2) {
browser.iOSVersion = browser.iOSVersion[0] + (browser.iOSVersion[1] / 10);
}
} }
browser.chromecast = browser.chrome && userAgent.toLowerCase().indexOf('crkey') !== -1; browser.chromecast = browser.chrome && userAgent.toLowerCase().indexOf('crkey') !== -1;