diff --git a/app/src/organisms/GripperWizardFlows/index.tsx b/app/src/organisms/GripperWizardFlows/index.tsx index 219fd687771..95d7e6f3500 100644 --- a/app/src/organisms/GripperWizardFlows/index.tsx +++ b/app/src/organisms/GripperWizardFlows/index.tsx @@ -120,12 +120,13 @@ export function GripperWizardFlows( const [errorMessage, setErrorMessage] = React.useState(null) const handleClose = (): void => { - if (props?.onComplete != null) props.onComplete() + if (props?.onComplete != null) { + props.onComplete() + } if (maintenanceRunData != null) { deleteMaintenanceRun(maintenanceRunData?.data.id) - } else { - closeFlow() } + closeFlow() } const { @@ -141,20 +142,21 @@ export function GripperWizardFlows( }) const handleCleanUpAndClose = (): void => { - if (maintenanceRunData?.data.id == null) handleClose() - else { + if (maintenanceRunData?.data.id == null) { + handleClose() + } else { chainRunCommands( maintenanceRunData?.data.id, [{ commandType: 'home' as const, params: {} }], false ) - .then(() => { - handleClose() - }) .catch(error => { setIsExiting(true) setErrorMessage(error.message as string) }) + .finally(() => { + handleClose() + }) } } diff --git a/app/src/organisms/PipetteWizardFlows/index.tsx b/app/src/organisms/PipetteWizardFlows/index.tsx index ad483b6ce5b..05e49c77eb9 100644 --- a/app/src/organisms/PipetteWizardFlows/index.tsx +++ b/app/src/organisms/PipetteWizardFlows/index.tsx @@ -182,12 +182,13 @@ export const PipetteWizardFlows = ( } } const handleClose = (): void => { - if (onComplete != null) onComplete() + if (onComplete != null) { + onComplete() + } if (maintenanceRunData != null) { deleteMaintenanceRun(maintenanceRunData?.data.id) - } else { - closeFlow() } + closeFlow() } const { @@ -210,13 +211,13 @@ export const PipetteWizardFlows = ( [{ commandType: 'home' as const, params: {} }], false ) - .then(() => { - handleClose() - }) .catch(error => { setIsExiting(true) setShowErrorMessage(error.message as string) }) + .finally(() => { + handleClose() + }) } } const {