Skip to content

Commit

Permalink
Merge pull request janhq#1831 from janhq/fix/dropdown-api-server
Browse files Browse the repository at this point in the history
fix: highlight menu dropdown server options
  • Loading branch information
urmauur authored Jan 29, 2024
2 parents 97a4978 + 50c4996 commit edaf6bb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions web/screens/LocalServer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const LocalServerScreen = () => {
const [host, setHost] = useAtom(hostAtom)
const [port, setPort] = useAtom(portAtom)

const hostOptions = ['127.0.0.1', '0.0.0.0']

const FIRST_TIME_VISIT_API_SERVER = 'firstTimeVisitAPIServer'

const [firstTimeVisitAPIServer, setFirstTimeVisitAPIServer] =
Expand Down Expand Up @@ -167,8 +169,19 @@ const LocalServerScreen = () => {
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="127.0.0.1">127.0.0.1</SelectItem>
<SelectItem value="0.0.0.0">0.0.0.0</SelectItem>
{hostOptions.map((option, i) => {
return (
<SelectItem
key={i}
value={option}
className={twMerge(
host === option && 'bg-secondary'
)}
>
{option}
</SelectItem>
)
})}
</SelectContent>
</Select>

Expand Down

0 comments on commit edaf6bb

Please sign in to comment.