diff --git a/src/ua.js b/src/ua.js index 834b609..7b602fa 100644 --- a/src/ua.js +++ b/src/ua.js @@ -26,7 +26,9 @@ export function parseUA(ua) { 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'; if (TABLET_UA_RE.test(ua)) device_type = 'tablet'; else if (MOBILE_UA_RE.test(ua)) device_type = 'mobile';