Skip to content

Commit b16fad1

Browse files
committed
Stay on loading state when agent script timings are empty
1 parent 2181bec commit b16fad1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

site/src/modules/workspaces/WorkspaceTiming/WorkspaceTimings.stories.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,11 @@ export const DuplicatedScriptTiming: Story = {
118118
],
119119
},
120120
};
121+
122+
// Loading when agent script timings are empty
123+
// Test case for https://github.com/coder/coder/issues/15273
124+
export const LoadingWhenAgentScriptTimingsAreEmpty: Story = {
125+
args: {
126+
agentScriptTimings: undefined,
127+
},
128+
};

site/src/modules/workspaces/WorkspaceTiming/WorkspaceTimings.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ export const WorkspaceTimings: FC<WorkspaceTimingsProps> = ({
6060
});
6161

6262
const [isOpen, setIsOpen] = useState(defaultIsOpen);
63-
const isLoading = timings.length === 0;
63+
64+
// If any of the timings are empty, we are still loading the data. They can be
65+
// filled in different moments.
66+
const isLoading = [
67+
provisionerTimings,
68+
agentScriptTimings,
69+
agentConnectionTimings,
70+
].some((t) => t.length === 0);
6471

6572
// Each agent connection timing is a stage in the timeline to make it easier
6673
// to users to see the timing for connection and the other scripts.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy