@@ -507,6 +507,7 @@ export function ProtocolRunHeader({
507
507
isFixtureMismatch = { isFixtureMismatch }
508
508
isResetRunLoadingRef = { isResetRunLoadingRef }
509
509
missingSetupSteps = { missingSetupSteps }
510
+ isClosingCurrentRun = { isClosingCurrentRun }
510
511
/>
511
512
</ Flex >
512
513
</ Box >
@@ -668,6 +669,7 @@ interface ActionButtonProps {
668
669
isFixtureMismatch : boolean
669
670
isResetRunLoadingRef : React . MutableRefObject < boolean >
670
671
missingSetupSteps : string [ ]
672
+ isClosingCurrentRun : boolean
671
673
}
672
674
673
675
// TODO(jh, 04-22-2024): Refactor switch cases into separate factories to increase readability and testability.
@@ -681,6 +683,7 @@ function ActionButton(props: ActionButtonProps): JSX.Element {
681
683
isFixtureMismatch,
682
684
isResetRunLoadingRef,
683
685
missingSetupSteps,
686
+ isClosingCurrentRun,
684
687
} = props
685
688
const navigate = useNavigate ( )
686
689
const { t } = useTranslation ( [ 'run_details' , 'shared' ] )
@@ -737,6 +740,7 @@ function ActionButton(props: ActionButtonProps): JSX.Element {
737
740
isPlayRunActionLoading ||
738
741
isPauseRunActionLoading ||
739
742
isResetRunLoading ||
743
+ isClosingCurrentRun ||
740
744
isOtherRunCurrent ||
741
745
isProtocolAnalyzing ||
742
746
isFixtureMismatch ||
@@ -814,6 +818,8 @@ function ActionButton(props: ActionButtonProps): JSX.Element {
814
818
START_RUN_STATUSES . includes ( runStatus )
815
819
) {
816
820
disableReason = t ( 'close_door' )
821
+ } else if ( isClosingCurrentRun ) {
822
+ disableReason = t ( 'shared:robot_is_busy' )
817
823
}
818
824
819
825
const shouldShowHSConfirm =
@@ -824,6 +830,9 @@ function ActionButton(props: ActionButtonProps): JSX.Element {
824
830
if ( isProtocolAnalyzing ) {
825
831
buttonIconName = 'ot-spinner'
826
832
buttonText = t ( 'analyzing_on_robot' )
833
+ } else if ( isClosingCurrentRun ) {
834
+ buttonIconName = 'ot-spinner'
835
+ buttonText = t ( 'canceling_run' )
827
836
} else if (
828
837
runStatus === RUN_STATUS_RUNNING ||
829
838
( runStatus != null && RECOVERY_STATUSES . includes ( runStatus ) )
@@ -903,7 +912,8 @@ function ActionButton(props: ActionButtonProps): JSX.Element {
903
912
spin = {
904
913
isProtocolAnalyzing ||
905
914
runStatus === RUN_STATUS_STOP_REQUESTED ||
906
- isResetRunLoading
915
+ isResetRunLoading ||
916
+ isClosingCurrentRun
907
917
}
908
918
/>
909
919
) : null }
0 commit comments