@@ -447,7 +447,8 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
447
447
const withPrebuild = WithPrebuild . is ( this . state . workspace ?. context ) ;
448
448
let phase : StartPhase | undefined = StartPhase . Preparing ;
449
449
let title = undefined ;
450
- let isTimedOut = false ;
450
+ let isStoppingOrStoppedPhase = false ;
451
+ let isError = error ? true : false ;
451
452
let statusMessage = ! ! error ? undefined : < p className = "text-base text-gray-400" > Preparing workspace …</ p > ;
452
453
const contextURL = ContextURL . getNormalizedURL ( this . state . workspace ) ?. toString ( ) ;
453
454
const useLatest = ! ! this . state . workspaceInstance ?. configuration ?. ideConfig ?. useLatest ;
@@ -620,6 +621,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
620
621
621
622
// Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
622
623
case "stopping" :
624
+ isStoppingOrStoppedPhase = true ;
623
625
if ( isPrebuild ) {
624
626
return (
625
627
< StartPage title = "Prebuild in Progress" >
@@ -657,6 +659,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
657
659
658
660
// Stopped means the workspace ended regularly because it was shut down.
659
661
case "stopped" :
662
+ isStoppingOrStoppedPhase = true ;
660
663
phase = StartPhase . Stopped ;
661
664
if ( this . state . hasImageBuildLogs ) {
662
665
const restartWithDefaultImage = ( event : React . MouseEvent ) => {
@@ -674,7 +677,6 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
674
677
}
675
678
if ( ! isPrebuild && this . state . workspaceInstance . status . conditions . timeout ) {
676
679
title = "Timed Out" ;
677
- isTimedOut = true ;
678
680
}
679
681
statusMessage = (
680
682
< div >
@@ -708,7 +710,12 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
708
710
break ;
709
711
}
710
712
return (
711
- < StartPage phase = { phase } error = { error } title = { title } showLatestIdeWarning = { ! isTimedOut && useLatest } >
713
+ < StartPage
714
+ phase = { phase }
715
+ error = { error }
716
+ title = { title }
717
+ showLatestIdeWarning = { useLatest && ( isError || ! isStoppingOrStoppedPhase ) }
718
+ >
712
719
{ statusMessage }
713
720
</ StartPage >
714
721
) ;
0 commit comments