diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx index 5d9821cc5a69..0f7796694162 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx @@ -152,6 +152,7 @@ export function ProtocolRunHeader({ displayName, protocolKey, isProtocolAnalyzing, + isQuickTransfer, } = useProtocolDetailsForRun(runId) const { reportRecoveredRunResult } = useRecoveryAnalytics() @@ -266,7 +267,13 @@ export function ProtocolRunHeader({ ...robotAnalyticsData, }, }) - closeCurrentRun() + closeCurrentRun({ + onSuccess: () => { + if (isQuickTransfer) { + navigate(`/devices/${robotName}`) + } + }, + }) } }, [runStatus, isRunCurrent, runId, closeCurrentRun]) @@ -314,7 +321,13 @@ export function ProtocolRunHeader({ name: ANALYTICS_PROTOCOL_RUN_ACTION.FINISH, properties: robotAnalyticsData ?? undefined, }) - closeCurrentRun() + closeCurrentRun({ + onSuccess: () => { + if (isQuickTransfer) { + navigate(`/devices/${robotName}`) + } + }, + }) } return ( @@ -416,7 +429,13 @@ export function ProtocolRunHeader({ onCloseClick={() => { resetTipStatus() setShowDropTipBanner(false) - closeCurrentRun() + closeCurrentRun({ + onSuccess: () => { + if (isQuickTransfer) { + navigate(`/devices/${robotName}`) + } + }, + }) }} /> ) : null} diff --git a/app/src/organisms/Devices/hooks/useProtocolDetailsForRun.ts b/app/src/organisms/Devices/hooks/useProtocolDetailsForRun.ts index 57c50666488e..13a00225383c 100644 --- a/app/src/organisms/Devices/hooks/useProtocolDetailsForRun.ts +++ b/app/src/organisms/Devices/hooks/useProtocolDetailsForRun.ts @@ -21,6 +21,7 @@ export interface ProtocolDetails { protocolKey: string | null isProtocolAnalyzing?: boolean robotType: RobotType + isQuickTransfer: boolean } export function useProtocolDetailsForRun( @@ -67,5 +68,6 @@ export function useProtocolDetailsForRun( (mostRecentAnalysis?.status === 'completed' ? mostRecentAnalysis?.robotType ?? FLEX_ROBOT_TYPE : FLEX_ROBOT_TYPE), + isQuickTransfer: protocolRecord?.data.protocolKind === 'quick-transfer', } }