From a756a1dcc38e7cf73abb93be4764e950b7f79966 Mon Sep 17 00:00:00 2001 From: Arlind Ukshini Date: Mon, 27 Apr 2026 10:46:47 +0200 Subject: [PATCH] events: document desktop fallback in UA parser --- src/ua.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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';