Skip to content

Commit

Permalink
fix(app): fix pipette offset cal data fetch issue on RobotSettings (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
koji authored Jun 9, 2022
1 parent 0e29be3 commit c11da0c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
useDeckCalibrationStatus,
useIsRobotBusy,
useAttachedPipettes,
useAttachedPipetteCalibrations,
} from '../hooks'
import { DeckCalibrationConfirmModal } from './DeckCalibrationConfirmModal'
import { PipetteOffsetCalibrationItems } from './CalibrationDetails/PipetteOffsetCalibrationItems'
Expand Down Expand Up @@ -144,9 +145,6 @@ export function RobotSettingsCalibration({
const deckCalStatus = useSelector((state: State) => {
return Calibration.getDeckCalibrationStatus(state, robotName)
})
const attachedPipetteCalibrations = useSelector((state: State) => {
return Pipettes.getAttachedPipetteCalibrations(state, robotName)
})
const deckCalibrationStatus = useDeckCalibrationStatus(robotName)
const dispatch = useDispatch<Dispatch>()

Expand Down Expand Up @@ -185,6 +183,7 @@ export function RobotSettingsCalibration({
const pipetteOffsetCalibrations = usePipetteOffsetCalibrations(robot?.name)
const tipLengthCalibrations = useTipLengthCalibrations(robot?.name)
const attachedPipettes = useAttachedPipettes()
const attachedPipetteCalibrations = useAttachedPipetteCalibrations(robotName)

const isRunning = useSelector(robotSelectors.getIsRunning)

Expand Down Expand Up @@ -262,7 +261,7 @@ export function RobotSettingsCalibration({
pipettePresent

const calCheckButtonDisabled = healthCheckIsPossible
? Boolean(buttonDisabledReason)
? Boolean(buttonDisabledReason) || isPending
: true

const onClickSaveAs: React.MouseEventHandler = e => {
Expand Down Expand Up @@ -465,6 +464,8 @@ export function RobotSettingsCalibration({
}
}, [createStatus])

// Note: following fetch need to reflect the latest state of calibrations
// when a user does calibration or rename a robot.
useInterval(
() => {
dispatch(Calibration.fetchCalibrationStatus(robotName))
Expand Down

0 comments on commit c11da0c

Please sign in to comment.