Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const MockProvisionerJob: TypesGen.ProvisionerJob = {
id: "test-provisioner-job",
status: "succeeded",
storage_source: "asdf",
completed_at: "2022-05-17T17:39:01.382927298Z",
}

export const MockFailedProvisionerJob: TypesGen.ProvisionerJob = {
Expand Down
11 changes: 6 additions & 5 deletions site/src/xServices/workspace/workspaceXService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,13 @@ export const workspaceMachine = createMachine(
}
},
getResources: async (context) => {
if (context.workspace) {
const resources = await API.getWorkspaceResources(context.workspace.latest_build.id)
return resources
} else {
throw Error("Cannot fetch workspace resources without workspace")
// If the job hasn't completed, fetching resources will result
// in an unfriendly error for the user.
if (!context.workspace?.latest_build.job.completed_at) {
return []
}
const resources = await API.getWorkspaceResources(context.workspace.latest_build.id)
return resources
},
getBuilds: async (context) => {
if (context.workspace) {
Expand Down
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