From 5c4b6870cffdd26aaee8f8bad68f8b7af09bc364 Mon Sep 17 00:00:00 2001 From: Leto Date: Thu, 26 Sep 2024 10:30:34 +0800 Subject: [PATCH] fix(dashboard): userAgentData may be undefined --- .../dashboard-editor/ui/header/spotlight/spotlight-control.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/src/dashboard-editor/ui/header/spotlight/spotlight-control.tsx b/dashboard/src/dashboard-editor/ui/header/spotlight/spotlight-control.tsx index 5f2740e7b..d4c6ae040 100644 --- a/dashboard/src/dashboard-editor/ui/header/spotlight/spotlight-control.tsx +++ b/dashboard/src/dashboard-editor/ui/header/spotlight/spotlight-control.tsx @@ -21,7 +21,7 @@ const ShortcutKeyText = ({ children }: { children: ReactNode }) => { const isMac = (function () { // @ts-expect-error userAgentData - const p = (navigator.userAgentData.platform ?? navigator.platform).toLowerCase(); + const p = (navigator.userAgentData?.platform ?? navigator.platform).toLowerCase(); return p.includes('mac'); })();