Skip to content

Commit

Permalink
fix(app): disable exit button after successful pipette attach/detach …
Browse files Browse the repository at this point in the history
…and 1 click

After a pipette is attached or detached successfully, the exit button should only be clickable once,
so that many home commands are not emitted in rapid succession with each click.

Closes RQA-2731
  • Loading branch information
ncdiehl11 committed May 16, 2024
1 parent 755a21b commit 3bda652
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/organisms/ChangePipette/ConfirmPipette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function ConfirmPipette(props: ConfirmPipetteProps): JSX.Element {
actualPipette,
setConfirmPipetteLevel,
confirmPipetteLevel,
isDisabled,
} = props
const { t } = useTranslation('change_pipette')

Expand Down Expand Up @@ -141,6 +142,7 @@ export function ConfirmPipette(props: ConfirmPipetteProps): JSX.Element {
<SuccessAndExitButtons
{...props}
confirmPipetteLevel={confirmPipetteLevel}
isDisabled={isDisabled}
/>
) : null}
</>
Expand Down Expand Up @@ -221,6 +223,7 @@ function SuccessAndExitButtons(props: ConfirmPipetteProps): JSX.Element {
toCalibrationDashboard,
success,
wrongWantedPipette,
isDisabled,
} = props
const { t } = useTranslation('change_pipette')
return (
Expand All @@ -234,7 +237,11 @@ function SuccessAndExitButtons(props: ConfirmPipetteProps): JSX.Element {
{t('calibrate_pipette_offset')}
</SecondaryButton>
) : null}
<PrimaryButton textTransform={TEXT_TRANSFORM_CAPITALIZE} onClick={exit}>
<PrimaryButton
textTransform={TEXT_TRANSFORM_CAPITALIZE}
onClick={exit}
disabled={isDisabled}
>
{t('shared:exit')}
</PrimaryButton>
</>
Expand Down

0 comments on commit 3bda652

Please sign in to comment.