Skip to content

Commit

Permalink
fix(app): don't re-open drop tip wizard flows if unrendered (#16540)
Browse files Browse the repository at this point in the history
Closes RQA-3287

In #16490, I made the disable/enable drop tip wizard states more explicit. However, I also removed the logic to toggle() the wizard if it abruptly closes, which sometimes happens if the pipette card unrenders. This just adds the unrender logic back and makes it more explicit: if the flow does close abruptly, it's important we do clean up the maintenance run, too.
  • Loading branch information
mjhuff authored Oct 18, 2024
1 parent dc1e40b commit 85e1427
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/organisms/DropTipWizardFlows/DropTipWizardFlows.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react'
import { useEffect, useState } from 'react'

import {
useDropTipLocations,
Expand Down Expand Up @@ -64,6 +64,14 @@ export function DropTipWizardFlows(
const dropTipRoutingUtils = useDropTipRouting(fixitCommandTypeUtils)
const dropTipCommandLocations = useDropTipLocations(props.robotType) // Prefetch to reduce client latency

// If the flow unrenders for any reason (ex, the pipette card managing the flow unrenders), don't re-render the flow
// after it closes.
useEffect(() => {
return () => {
dropTipWithTypeUtils.dropTipCommands.handleCleanUpAndClose()
}
}, [])

return (
<DropTipWizard
{...props}
Expand Down

0 comments on commit 85e1427

Please sign in to comment.