From 48f57c6dd2e419adf1675ea9d0decedae9293c97 Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Tue, 16 Jul 2024 08:54:35 +0200 Subject: [PATCH] guard userAgentData access This property is not always available. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData#browser_compatibility --- frontend/common/KeyboardShortcuts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/common/KeyboardShortcuts.js b/frontend/common/KeyboardShortcuts.js index 0f6feaf62d..e099161923 100644 --- a/frontend/common/KeyboardShortcuts.js +++ b/frontend/common/KeyboardShortcuts.js @@ -1,5 +1,5 @@ // @ts-ignore -export let is_mac_keyboard = /Mac/i.test(navigator.userAgentData.platform ?? navigator.platform) +export let is_mac_keyboard = /Mac/i.test(navigator.userAgentData?.platform ?? navigator.platform) export let control_name = is_mac_keyboard ? "⌃" : "Ctrl" export let ctrl_or_cmd_name = is_mac_keyboard ? "⌘" : "Ctrl"