Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions docs/src/components/Download/CardDownload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@ type SystemType = {

const systemsTemplate: SystemType[] = [
{
name: 'Mac M1, M2, M3',
label: 'Apple Silicon',
name: 'Mac ',
label: 'Universal',
logo: FaApple,
fileFormat: '{appname}-mac-arm64-{tag}.dmg',
},
{
name: 'Mac (Intel)',
label: 'Apple Intel',
logo: FaApple,
fileFormat: '{appname}-mac-x64-{tag}.dmg',
fileFormat: '{appname}-mac-universal-{tag}.dmg',
},

{
name: 'Windows',
label: 'Standard (64-bit)',
Expand Down
44 changes: 16 additions & 28 deletions docs/src/components/DropdownDownload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ type GpuInfo = {

const systemsTemplate: SystemType[] = [
{
name: 'Download for Mac (M1/M2/M3)',
name: 'Download for Mac',
logo: FaApple,
fileFormat: '{appname}-mac-arm64-{tag}.dmg',
},
{
name: 'Download for Mac (Intel)',
logo: FaApple,
fileFormat: '{appname}-mac-x64-{tag}.dmg',
fileFormat: '{appname}-mac-universal-{tag}.dmg',
},
{
name: 'Download for Windows',
Expand Down Expand Up @@ -66,27 +61,20 @@ const DropdownDownload = ({ lastRelease }: Props) => {
type: '',
})

const changeDefaultSystem = useCallback(
async (systems: SystemType[]) => {
const userAgent = navigator.userAgent
if (userAgent.includes('Windows')) {
// windows user
setDefaultSystem(systems[2])
} else if (userAgent.includes('Linux')) {
// linux user
setDefaultSystem(systems[3])
} else if (userAgent.includes('Mac OS')) {
if (gpuInfo.type === 'Apple Silicon') {
setDefaultSystem(systems[0])
} else {
setDefaultSystem(systems[1])
}
} else {
setDefaultSystem(systems[1])
}
},
[gpuInfo.type]
)
const changeDefaultSystem = useCallback(async (systems: SystemType[]) => {
const userAgent = navigator.userAgent
if (userAgent.includes('Windows')) {
// windows user
setDefaultSystem(systems[2])
} else if (userAgent.includes('Linux')) {
// linux user
setDefaultSystem(systems[3])
} else if (userAgent.includes('Mac OS')) {
setDefaultSystem(systems[0])
} else {
setDefaultSystem(systems[1])
}
}, [])

function getUnmaskedInfo(gl: WebGLRenderingContext): {
renderer: string
Expand Down
Loading