Skip to content

Commit

Permalink
format and remove todos
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Aug 3, 2023
1 parent fe52c3c commit 5fe44ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/src/organisms/Devices/InstrumentsAndModules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export function InstrumentsAndModules({
setSubsystemToUpdate,
] = React.useState<Subsystem | null>(null)

const { data: attachedInstruments } = useInstrumentsQuery()
// TODO(bc, 2023-03-20): reintroduce this poll, once it is safe to call cache_instruments during sensor reads on CAN bus
// { refetchInterval: EQUIPMENT_POLL_MS, },
const { data: attachedInstruments } = useInstrumentsQuery({
refetchInterval: EQUIPMENT_POLL_MS,
})
const attachedGripper =
(attachedInstruments?.data ?? []).find(
(i): i is GripperData => i.instrumentType === 'gripper' && i.ok
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export function SetupInstrumentCalibration({
const { t } = useTranslation('protocol_setup')
const runPipetteInfoByMount = useRunPipetteInfoByMount(runId)

const { data: instrumentsQueryData, refetch } = useInstrumentsQuery({refetchInterval: EQUIPMENT_POLL_MS})
const { data: instrumentsQueryData, refetch } = useInstrumentsQuery({
refetchInterval: EQUIPMENT_POLL_MS,
})
const mostRecentAnalysis = useMostRecentCompletedAnalysis(runId)
const storedProtocolAnalysis = useStoredProtocolAnalysis(runId)
const usesGripper = isGripperInCommands(
Expand Down
4 changes: 2 additions & 2 deletions app/src/organisms/GripperWizardFlows/MountGripper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const GO_BACK_BUTTON_STYLE = css`
}
}
`
const QUICK_GRIPPER_POLL_MS = 3000

export const MountGripper = (
props: GripperWizardStepProps
Expand All @@ -51,9 +52,8 @@ export const MountGripper = (
const isOnDevice = useSelector(getIsOnDevice)
const [showUnableToDetect, setShowUnableToDetect] = React.useState(false)
const [isPending, setIsPending] = React.useState(false)
// TODO(bc, 2023-03-23): remove this temporary local poll in favor of the single top level poll in InstrumentsAndModules
const { data: instrumentsQueryData, refetch } = useInstrumentsQuery({
refetchInterval: 3000,
refetchInterval: QUICK_GRIPPER_POLL_MS,
})
const isGripperAttached = (instrumentsQueryData?.data ?? []).some(
(i): i is GripperData | BadGripper => i.instrumentType === 'gripper'
Expand Down
6 changes: 3 additions & 3 deletions app/src/organisms/GripperWizardFlows/UnmountGripper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ const GO_BACK_BUTTON_TEXT_STYLE = css`
}
`

const QUICK_GRIPPER_POLL_MS = 3000

export const UnmountGripper = (
props: GripperWizardStepProps
): JSX.Element | null => {
const { proceed, isRobotMoving, goBack, chainRunCommands } = props
const { t } = useTranslation(['gripper_wizard_flows', 'shared'])
const isOnDevice = useSelector(getIsOnDevice)
const [isPending, setIsPending] = React.useState<boolean>(false)

// TODO(bc, 2023-03-23): remove this temporary local poll in favor of the single top level poll in InstrumentsAndModules
const { data: instrumentsQueryData, refetch } = useInstrumentsQuery({
refetchInterval: 3000,
refetchInterval: QUICK_GRIPPER_POLL_MS,
})
const isGripperStillAttached = (instrumentsQueryData?.data ?? []).some(
(i): i is GripperData => i.instrumentType === 'gripper' && i.ok
Expand Down

0 comments on commit 5fe44ea

Please sign in to comment.