events: document desktop fallback in UA parser
This commit is contained in:
parent
d974e865c2
commit
a756a1dcc3
1 changed files with 3 additions and 1 deletions
|
|
@ -26,7 +26,9 @@ export function parseUA(ua) {
|
||||||
return { device_type: null, os: null, browser: null };
|
return { device_type: null, os: null, browser: null };
|
||||||
}
|
}
|
||||||
|
|
||||||
// device_type
|
// device_type — fallback is 'desktop' to mirror server.js
|
||||||
|
// wantsMobileView() (unrecognised UA → desktop page). Analytics
|
||||||
|
// stay consistent with what the user actually saw.
|
||||||
let device_type = 'desktop';
|
let device_type = 'desktop';
|
||||||
if (TABLET_UA_RE.test(ua)) device_type = 'tablet';
|
if (TABLET_UA_RE.test(ua)) device_type = 'tablet';
|
||||||
else if (MOBILE_UA_RE.test(ua)) device_type = 'mobile';
|
else if (MOBILE_UA_RE.test(ua)) device_type = 'mobile';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue