Skip to content

Commit 1feba0b

Browse files
committed
fix: there's no such architecture arm64
1 parent c372032 commit 1feba0b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/site/hooks/react-client/useDetectOS.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
Bitness,
88
OperatingSystem,
99
} from '#site/types/userAgent';
10-
import { getHighEntropyValues, detectOS } from '#site/util/userAgent';
10+
import { detectOS, getHighEntropyValues } from '#site/util/userAgent';
1111

1212
type UserOSState = {
1313
os: OperatingSystem | 'LOADING';
@@ -42,10 +42,12 @@ const useDetectOS = () => {
4242
({
4343
// If there is no getHighEntropyValues API on the Browser or it failed to resolve
4444
// we attempt to fallback to what the User Agent indicates
45-
bitness = uaIndicates64 ? '64' : '32',
45+
bitness = os === 'MAC' || uaIndicates64 ? '64' : '32',
4646
// we assume that MacOS has moved to arm64 by default now
47-
architecture = os === 'MAC' ? 'arm64' : 'x86',
47+
architecture = os === 'MAC' ? 'arm' : 'x86',
4848
}) => {
49+
console.log({ bitness, architecture });
50+
4951
setUserOSState(current => ({
5052
...current,
5153
bitness: bitness as Bitness,

0 commit comments

Comments
 (0)