@@ -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 ;
@@ -623,6 +624,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
623
624
624
625
// Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
625
626
case "stopping" :
627
+ isStoppingOrStoppedPhase = true ;
626
628
if ( isPrebuild ) {
627
629
return (
628
630
< StartPage title = "Prebuild in Progress" >
@@ -660,6 +662,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
660
662
661
663
// Stopped means the workspace ended regularly because it was shut down.
662
664
case "stopped" :
665
+ isStoppingOrStoppedPhase = true ;
663
666
phase = StartPhase . Stopped ;
664
667
if ( this . state . hasImageBuildLogs ) {
665
668
const restartWithDefaultImage = ( event : React . MouseEvent ) => {
@@ -677,7 +680,6 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
677
680
}
678
681
if ( ! isPrebuild && this . state . workspaceInstance . status . conditions . timeout ) {
679
682
title = "Timed Out" ;
680
- isTimedOut = true ;
681
683
}
682
684
statusMessage = (
683
685
< div >
@@ -711,7 +713,12 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
711
713
break ;
712
714
}
713
715
return (
714
- < StartPage phase = { phase } error = { error } title = { title } showLatestIdeWarning = { ! isTimedOut && useLatest } >
716
+ < StartPage
717
+ phase = { phase }
718
+ error = { error }
719
+ title = { title }
720
+ showLatestIdeWarning = { useLatest && ( isError || ! isStoppingOrStoppedPhase ) }
721
+ >
715
722
{ statusMessage }
716
723
</ StartPage >
717
724
) ;
0 commit comments