Skip to content

Commit

Permalink
Preselect robot if there is only one robot
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Dec 2, 2024
1 parent a0cf432 commit 28482db
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const ScheduleMissionDialog = (props: IProps): JSX.Element => {
r.status === RobotStatus.Recharging) &&
r.isarConnected
)

const onSelectedRobot = (selectedRobot: Robot) => {
if (filteredRobots) setSelectedRobot(selectedRobot)
}
Expand Down Expand Up @@ -151,6 +152,7 @@ export const ScheduleMissionDialog = (props: IProps): JSX.Element => {
)}
<StyledAutoComplete>
<Autocomplete
initialSelectedOptions={filteredRobots.length === 1 ? [filteredRobots[0]] : []}
dropdownHeight={200}
optionLabel={(r) => r.name + ' (' + r.model.type + ')'}
options={filteredRobots}
Expand Down

0 comments on commit 28482db

Please sign in to comment.