watchman device type is web for browsers (#6901)
* watchman device type is web for browsers * no watchman on desktop
This commit is contained in:
parent
5d889bef27
commit
9bbe8b1c63
1 changed files with 15 additions and 14 deletions
|
@ -87,19 +87,20 @@ if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEna
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
function getDeviceType() {
|
function getDeviceType() {
|
||||||
if (!IS_WEB) {
|
// We may not care what the device is if it's in a web browser. Commenting out for now.
|
||||||
return 'elt';
|
// if (!IS_WEB) {
|
||||||
}
|
// return 'elt';
|
||||||
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
// }
|
||||||
|
// const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
||||||
if (/android/i.test(userAgent)) {
|
//
|
||||||
return 'adr';
|
// if (/android/i.test(userAgent)) {
|
||||||
}
|
// return 'adr';
|
||||||
|
// }
|
||||||
// iOS detection from: http://stackoverflow.com/a/9039885/177710
|
//
|
||||||
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
|
// // iOS detection from: http://stackoverflow.com/a/9039885/177710
|
||||||
return 'ios';
|
// if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
|
||||||
}
|
// return 'ios';
|
||||||
|
// }
|
||||||
|
|
||||||
// default as web, this can be optimized
|
// default as web, this can be optimized
|
||||||
return 'web';
|
return 'web';
|
||||||
|
@ -168,7 +169,7 @@ function startWatchmanIntervalIfNotRunning() {
|
||||||
lastSentTime = new Date();
|
lastSentTime = new Date();
|
||||||
|
|
||||||
// only set an interval if analytics are enabled and is prod
|
// only set an interval if analytics are enabled and is prod
|
||||||
if (internalAnalyticsEnabled && isProduction) {
|
if (isProduction && IS_WEB) {
|
||||||
watchmanInterval = setInterval(sendAndResetWatchmanData, 1000 * SEND_DATA_TO_WATCHMAN_INTERVAL);
|
watchmanInterval = setInterval(sendAndResetWatchmanData, 1000 * SEND_DATA_TO_WATCHMAN_INTERVAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue