From aca33fb050fdbbe20cde656ab029d617ff3a64b7 Mon Sep 17 00:00:00 2001 From: Jamey Huffnagle Date: Fri, 18 Oct 2024 15:58:40 -0400 Subject: [PATCH] fix(app): don't re-open drop tip wizard flows if unrendered --- .../DropTipWizardFlows/DropTipWizardFlows.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/organisms/DropTipWizardFlows/DropTipWizardFlows.tsx b/app/src/organisms/DropTipWizardFlows/DropTipWizardFlows.tsx index 5684b123afba..56414bb0abe6 100644 --- a/app/src/organisms/DropTipWizardFlows/DropTipWizardFlows.tsx +++ b/app/src/organisms/DropTipWizardFlows/DropTipWizardFlows.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' import { useDropTipLocations, @@ -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 () => { + props.closeFlow() + } + }, []) + return (