File tree 2 files changed +14
-5
lines changed
site/src/pages/WorkspacePage
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,16 @@ type Story = StoryObj<typeof Workspace>;
63
63
64
64
export const Running : Story = {
65
65
args : {
66
- workspace : Mocks . MockWorkspace ,
66
+ workspace : {
67
+ ...Mocks . MockWorkspace ,
68
+ latest_build : {
69
+ ...Mocks . MockWorkspace . latest_build ,
70
+ matched_provisioners : {
71
+ count : 0 ,
72
+ available : 0 ,
73
+ } ,
74
+ } ,
75
+ } ,
67
76
handleStart : action ( "start" ) ,
68
77
handleStop : action ( "stop" ) ,
69
78
buildInfo : Mocks . MockBuildInfo ,
Original file line number Diff line number Diff line change @@ -110,13 +110,13 @@ export const Workspace: FC<WorkspaceProps> = ({
110
110
( r ) => resourceOptionValue ( r ) === resourcesNav . value ,
111
111
) ;
112
112
113
- const shouldDisplayBuildLogs =
114
- ( buildLogs ?? [ ] ) . length > 0 && workspace . latest_build . status !== "running" ;
115
-
113
+ const workspaceRunning = workspace . latest_build . status === "running" ;
114
+ const haveBuildLogs = ( buildLogs ?? [ ] ) . length > 0 ;
116
115
const provisionersHealthy =
117
116
( workspace . latest_build . matched_provisioners ?. available ?? 0 ) > 0 ;
117
+ const shouldDisplayBuildLogs = haveBuildLogs && ! workspaceRunning ;
118
118
const shouldShowProvisionerAlert =
119
- ! provisionersHealthy && ( ! buildLogs || buildLogs . length === 0 ) ;
119
+ ! workspaceRunning && ! haveBuildLogs && ! provisionersHealthy ;
120
120
121
121
return (
122
122
< div
You can’t perform that action at this time.
0 commit comments