Skip to content

Commit 0610276

Browse files
authored
feat: auto selects users os (#5445)
1 parent 09a9484 commit 0610276

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/homepageExperience/components/steps/cli/InstallDependencies.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ import {
1111

1212
import React, {FC, useEffect, useState} from 'react'
1313
import {event} from 'src/cloud/utils/reporting'
14-
import {keyboardCopyTriggered, userSelection} from 'src/utils/crossPlatform'
14+
import {
15+
isUsingLinux,
16+
isUsingWindows,
17+
keyboardCopyTriggered,
18+
userSelection,
19+
} from 'src/utils/crossPlatform'
1520

1621
export const InstallDependencies: FC = () => {
1722
const headingWithMargin = {marginTop: '48px', marginBottom: '0px'}
@@ -47,8 +52,17 @@ sudo cp influxdb2-client-latest-linux-arm64/influx /usr/local/bin/
4752
`
4853

4954
type CurrentOSSelection = 'Linux' | 'Mac' | 'Windows'
55+
const initSelection = () => {
56+
if (isUsingWindows()) {
57+
return 'Windows'
58+
} else if (isUsingLinux()) {
59+
return 'Linux'
60+
} else {
61+
return 'Mac'
62+
}
63+
}
5064
const [currentSelection, setCurrentSelection] = useState<CurrentOSSelection>(
51-
'Mac'
65+
initSelection()
5266
)
5367

5468
useEffect(() => {

0 commit comments

Comments
 (0)