Skip to content

Commit

Permalink
Move fallback to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cbodfield authored May 6, 2024
1 parent 64e1892 commit ba5ba48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ function localizeMod(hotkey: string, platform?: string | undefined): string {
const ssrSafeWindow = typeof window === "undefined" ? undefined : window

Check failure on line 92 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

Replace `"undefined"` with `'undefined'`

Check failure on line 92 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

Replace `"undefined"` with `'undefined'`
const safePlatform = ssrSafeWindow

Check failure on line 93 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

'safePlatform' is assigned a value but never used

Check failure on line 93 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

Replace `⏎····?·ssrSafeWindow.navigator.platform⏎···` with `·?·ssrSafeWindow.navigator.platform`

Check failure on line 93 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

'safePlatform' is assigned a value but never used

Check failure on line 93 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

Replace `⏎····?·ssrSafeWindow.navigator.platform⏎···` with `·?·ssrSafeWindow.navigator.platform`
? ssrSafeWindow.navigator.platform
: (platform ?? "")
: platform

const localModifier = matchApplePlatform.test(platform) ? 'Meta' : 'Control'
const localModifier = matchApplePlatform.test(platform ?? "") ? 'Meta' : 'Control'

Check failure on line 97 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

Replace `""` with `''`

Check failure on line 97 in src/hotkey.ts

View workflow job for this annotation

GitHub Actions / build

Replace `""` with `''`
return hotkey.replace('Mod', localModifier)
}

Expand Down

0 comments on commit ba5ba48

Please sign in to comment.