Skip to content

Commit b3851d8

Browse files
Hide the latest editor warning for stopping or stopped workspaces (#16940)
1 parent c292f36 commit b3851d8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
447447
const withPrebuild = WithPrebuild.is(this.state.workspace?.context);
448448
let phase: StartPhase | undefined = StartPhase.Preparing;
449449
let title = undefined;
450-
let isTimedOut = false;
450+
let isStoppingOrStoppedPhase = false;
451+
let isError = error ? true : false;
451452
let statusMessage = !!error ? undefined : <p className="text-base text-gray-400">Preparing workspace …</p>;
452453
const contextURL = ContextURL.getNormalizedURL(this.state.workspace)?.toString();
453454
const useLatest = !!this.state.workspaceInstance?.configuration?.ideConfig?.useLatest;
@@ -620,6 +621,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
620621

621622
// Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
622623
case "stopping":
624+
isStoppingOrStoppedPhase = true;
623625
if (isPrebuild) {
624626
return (
625627
<StartPage title="Prebuild in Progress">
@@ -657,6 +659,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
657659

658660
// Stopped means the workspace ended regularly because it was shut down.
659661
case "stopped":
662+
isStoppingOrStoppedPhase = true;
660663
phase = StartPhase.Stopped;
661664
if (this.state.hasImageBuildLogs) {
662665
const restartWithDefaultImage = (event: React.MouseEvent) => {
@@ -674,7 +677,6 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
674677
}
675678
if (!isPrebuild && this.state.workspaceInstance.status.conditions.timeout) {
676679
title = "Timed Out";
677-
isTimedOut = true;
678680
}
679681
statusMessage = (
680682
<div>
@@ -708,7 +710,12 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
708710
break;
709711
}
710712
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+
>
712719
{statusMessage}
713720
</StartPage>
714721
);

0 commit comments

Comments
 (0)