fix(suboptimal): ignore mobile browsers in whitelists/blacklists

This commit is contained in:
Leonard Kim 2019-06-20 08:43:31 -07:00 committed by Дамян Минков
parent 033aa0dd6e
commit d5e0dea469
1 changed files with 14 additions and 7 deletions

View File

@ -66,11 +66,10 @@ export function isSupportedBrowser() {
return false;
}
const isBlacklistedBrowser = _isCurrentBrowserInList(
// Blacklists apply to desktop browsers only right now.
if (!_isMobileBrowser() && _isCurrentBrowserInList(
interfaceConfig.UNSUPPORTED_BROWSERS || DEFAULT_UNSUPPORTED_BROWSERS
);
if (isBlacklistedBrowser) {
)) {
return false;
}
@ -78,9 +77,7 @@ export function isSupportedBrowser() {
// - the WelcomePage is mobile ready;
// - if the URL points to a conference then deep-linking will take
// care of it.
return Platform.OS === 'android'
|| Platform.OS === 'ios'
|| JitsiMeetJS.isWebRtcSupported();
return _isMobileBrowser() || JitsiMeetJS.isWebRtcSupported();
}
/**
@ -99,3 +96,13 @@ function _isCurrentBrowserInList(list) {
return checkFunction ? checkFunction.call(browser) : false;
}));
}
/**
* Returns whether or not the current environment is a mobile device.
*
* @private
* @returns {boolean}
*/
function _isMobileBrowser() {
return Platform.OS === 'android' || Platform.OS === 'ios';
}