Fix button download detect intel or m1, m2
This commit is contained in:
parent
51e7d87328
commit
f54894294e
@ -53,19 +53,28 @@ export default function Dropdown() {
|
|||||||
return match ? match[1] : null;
|
return match ? match[1] : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeDefaultSystem = (systems) => {
|
const changeDefaultSystem = async (systems) => {
|
||||||
const userAgent = navigator.userAgent;
|
const userAgent = navigator.userAgent;
|
||||||
|
|
||||||
|
const arc = await navigator?.userAgentData?.getHighEntropyValues([
|
||||||
|
"architecture",
|
||||||
|
]);
|
||||||
|
|
||||||
if (userAgent.includes("Windows")) {
|
if (userAgent.includes("Windows")) {
|
||||||
// windows user
|
// windows user
|
||||||
setDefaultSystem(systems[2]);
|
setDefaultSystem(systems[2]);
|
||||||
} else if (userAgent.includes("Linux")) {
|
} else if (userAgent.includes("Linux")) {
|
||||||
// linux user
|
// linux user
|
||||||
setDefaultSystem(systems[3]);
|
setDefaultSystem(systems[3]);
|
||||||
} else if (userAgent.includes("Mac OS") && userAgent.includes("Intel")) {
|
} else if (userAgent.includes("Mac OS")) {
|
||||||
// mac intel user
|
if (arc && arc.architecture === "arm") {
|
||||||
setDefaultSystem(systems[1]);
|
// mac m1, m2
|
||||||
|
setDefaultSystem(systems[0]);
|
||||||
|
} else {
|
||||||
|
// mac user intel
|
||||||
|
setDefaultSystem(systems[1]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// mac user and also default
|
|
||||||
setDefaultSystem(systems[0]);
|
setDefaultSystem(systems[0]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user