Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 845367e

Browse files
committed
Fix builds to show empty instead of loading
1 parent 56a69b7 commit 845367e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

site/src/api/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ export const regenerateUserSSHKey = async (
564564
export const getWorkspaceBuilds = async (
565565
workspaceId: string,
566566
since: Date,
567-
): Promise<TypesGen.WorkspaceBuild[]> => {
567+
): Promise<TypesGen.WorkspaceBuild[] | null> => {
568568
const response = await axios.get<TypesGen.WorkspaceBuild[]>(
569569
`/api/v2/workspaces/${workspaceId}/builds?since=${since.toISOString()}`,
570570
)

site/src/xServices/workspace/workspaceXService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,11 @@ export const workspaceMachine = createMachine(
717717
if (context.workspace) {
718718
// For now, we only retrieve the last month of builds to minimize
719719
// page bloat. We should add pagination in the future.
720-
return await API.getWorkspaceBuilds(
720+
const builds = await API.getWorkspaceBuilds(
721721
context.workspace.id,
722722
dayjs().add(-30, "day").toDate(),
723723
)
724+
return builds ?? []
724725
} else {
725726
throw Error("Cannot get builds without id")
726727
}

0 commit comments

Comments
 (0)