Skip to content

Commit 011915e

Browse files
committed
fix: changes dummy workspace logic to include starting and stopping
1 parent be72f80 commit 011915e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

App/ViewModels/TrayWindowViewModel.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
207207
// For every stopped workspace that doesn't have any agents, add a
208208
// dummy agent row.
209209
foreach (var workspace in rpcModel.Workspaces.Where(w =>
210-
w.Status == Workspace.Types.Status.Stopped && !workspacesWithAgents.Contains(w.Id)))
210+
ShouldShowDummy(w) && !workspacesWithAgents.Contains(w.Id)))
211211
{
212212
if (!Uuid.TryFrom(workspace.Id.Span, out var uuid))
213213
continue;
@@ -372,4 +372,21 @@ public void Exit()
372372
{
373373
_ = ((App)Application.Current).ExitApplication();
374374
}
375+
376+
private static bool ShouldShowDummy(Workspace workspace)
377+
{
378+
switch (workspace.Status)
379+
{
380+
case Workspace.Types.Status.Unknown:
381+
case Workspace.Types.Status.Pending:
382+
case Workspace.Types.Status.Starting:
383+
case Workspace.Types.Status.Stopping:
384+
case Workspace.Types.Status.Stopped:
385+
return true;
386+
// TODO: should we include and show a different color than Gray for workspaces that are
387+
// failed, canceled or deleting?
388+
default:
389+
return false;
390+
}
391+
}
375392
}

0 commit comments

Comments
 (0)