Skip to content

Commit

Permalink
navigator may not be defined in some environments, like non-browser e…
Browse files Browse the repository at this point in the history
…nvironments
  • Loading branch information
acwhite211 committed Jan 28, 2025
1 parent c73d10b commit dacec9e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const isDarkMode = ({
isRedirecting,
}: PreferencesVisibilityContext): boolean => isDarkMode || isRedirecting;

const altKeyName = globalThis.navigator?.userAgent?.includes('Mac')
// navigator may not be defined in some environments, like non-browser environments
const altKeyName = typeof navigator !== 'undefined' && navigator?.userAgent?.includes('Mac')
? 'Option'
: 'Alt';

Expand Down

0 comments on commit dacec9e

Please sign in to comment.