Skip to content

Commit ed2aca4

Browse files
Devansu-Yadavgtsiolis
authored andcommitted
Hide the latest editor warning for stopping or stopped workspaces (#16940)
1 parent 9b06d2e commit ed2aca4

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;
@@ -623,6 +624,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
623624

624625
// Stopping means that the workspace is currently shutting down. It could go to stopped every moment.
625626
case "stopping":
627+
isStoppingOrStoppedPhase = true;
626628
if (isPrebuild) {
627629
return (
628630
<StartPage title="Prebuild in Progress">
@@ -660,6 +662,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
660662

661663
// Stopped means the workspace ended regularly because it was shut down.
662664
case "stopped":
665+
isStoppingOrStoppedPhase = true;
663666
phase = StartPhase.Stopped;
664667
if (this.state.hasImageBuildLogs) {
665668
const restartWithDefaultImage = (event: React.MouseEvent) => {
@@ -677,7 +680,6 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
677680
}
678681
if (!isPrebuild && this.state.workspaceInstance.status.conditions.timeout) {
679682
title = "Timed Out";
680-
isTimedOut = true;
681683
}
682684
statusMessage = (
683685
<div>
@@ -711,7 +713,12 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
711713
break;
712714
}
713715
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+
>
715722
{statusMessage}
716723
</StartPage>
717724
);

0 commit comments

Comments
 (0)