Skip to content

Commit

Permalink
Filter robots by available or busy status
Browse files Browse the repository at this point in the history
  • Loading branch information
betaniat committed Jul 19, 2024
1 parent 5f562db commit fff2172
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components'
import { useLanguageContext } from 'components/Contexts/LanguageContext'
import { memo, useState } from 'react'
import { useInstallationContext } from 'components/Contexts/InstallationContext'
import { Robot } from 'models/Robot'
import { Robot, RobotStatus } from 'models/Robot'
import { EchoMissionDefinition } from 'models/MissionDefinition'
import { useRobotContext } from 'components/Contexts/RobotContext'
import { BackendAPICaller } from 'api/ApiCaller'
Expand Down Expand Up @@ -156,7 +156,9 @@ const SelectRobotComponent = memo(
options={enabledRobots.filter(
(r) =>
r.currentInstallation.installationCode.toLocaleLowerCase() ===
installationCode.toLocaleLowerCase()
installationCode.toLocaleLowerCase() &&
(r.status === RobotStatus.Available || r.status === RobotStatus.Busy) &&
r.isarConnected
)}
disabled={!enabledRobots}
selectedOptions={[selectedRobot]}
Expand Down

0 comments on commit fff2172

Please sign in to comment.