Skip to content

Commit

Permalink
fix(app): don't re-open drop tip wizard flows if unrendered
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Oct 18, 2024
1 parent d25d3ee commit 66c0fa6
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 66c0fa6

Please sign in to comment.