Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cbodfield authored May 6, 2024
1 parent ba5ba48 commit b526f69
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ export function normalizeHotkey(hotkey: string, platform?: string | undefined):
const matchApplePlatform = /Mac|iPod|iPhone|iPad/i

function localizeMod(hotkey: string, platform?: string | undefined): string {
const ssrSafeWindow = typeof window === "undefined" ? undefined : window
const safePlatform = ssrSafeWindow
? ssrSafeWindow.navigator.platform
: platform
const ssrSafeWindow = typeof window === 'undefined' ? undefined : window
const safePlatform = ssrSafeWindow ? ssrSafeWindow.navigator.platform : platform

const localModifier = matchApplePlatform.test(platform ?? "") ? 'Meta' : 'Control'
const localModifier = matchApplePlatform.test(safePlatform ?? '') ? 'Meta' : 'Control'
return hotkey.replace('Mod', localModifier)
}

Expand Down

0 comments on commit b526f69

Please sign in to comment.