Skip to content

Commit

Permalink
fix(protocol-designer): fix back button in select pipette screen (#17246
Browse files Browse the repository at this point in the history
)

* fix(protocol-designer): fix back button in select pipette screen
  • Loading branch information
koji authored Jan 10, 2025
1 parent fd67323 commit 9095cc8
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,15 @@ export function SelectPipettes(props: WizardTileProps): JSX.Element | null {
}
}

const clearPipettes = (): void => {
resetFields()
setValue(`pipettesByMount.${mount}.pipetteName`, undefined)
setValue(`pipettesByMount.${mount}.tiprackDefURI`, undefined)
}

const handleGoBack = (): void => {
if (page === 'add') {
resetFields()
setValue(`pipettesByMount.${mount}.pipetteName`, undefined)
setValue(`pipettesByMount.${mount}.tiprackDefURI`, undefined)
clearPipettes()
if (
pipettesByMount.left.pipetteName != null ||
pipettesByMount.left.tiprackDefURI != null ||
Expand All @@ -152,7 +156,8 @@ export function SelectPipettes(props: WizardTileProps): JSX.Element | null {
}
}
if (page === 'overview') {
setPage('add')
clearPipettes()
goBack(1)
}
}

Expand Down

0 comments on commit 9095cc8

Please sign in to comment.