We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab1e8ae commit da410adCopy full SHA for da410ad
app/composables/usePlatformModifierKey.ts
@@ -1,3 +1,5 @@
1
+const APPLE_PLATFORM_RE = /Mac|iPhone|iPad|iPod/i
2
+
3
function detectApplePlatform() {
4
if (!import.meta.client) return false
5
@@ -10,7 +12,7 @@ function detectApplePlatform() {
10
12
const platform = nav.userAgentData?.platform ?? nav.platform ?? ''
11
13
const userAgent = navigator.userAgent ?? ''
14
- return /Mac|iPhone|iPad|iPod/i.test(platform) || /Mac|iPhone|iPad|iPod/i.test(userAgent)
15
+ return APPLE_PLATFORM_RE.test(platform) || APPLE_PLATFORM_RE.test(userAgent)
16
}
17
18
export function usePlatformModifierKey() {
0 commit comments